fix(types): restore the six host fields the vendored contract dropped - #71
Merged
Merged
Conversation
The header says the file was verified field-by-field against six core files at v0.14.0. A member-level diff finds six fields it does not carry, none of them annotated as a deliberate narrowing — which is how this file marks everything else it leaves out. IncomingMessage was missing `ephemeralDuration`, `call`, `backgroundColor` and `font`; ChatSummary was missing `kind`; ConversationSendEnvelope was missing `linkPreview`. Four of the six predated the v0.14.0 alignment by several minor versions, so they were not a lag behind a moving host — they were simply missed. Nothing was broken by their absence: a plugin needing one could cast. But the cost is exactly what a vendored contract exists to prevent — the author of a status-relay plugin has no way to discover that `backgroundColor` and `font` are on the payload, and the author of a link-relaying plugin has no way to discover `linkPreview`, which is the difference between a rich preview and a bare URL on Baileys. `ChatSummary.kind` is required here, as it is in core; nothing constructs a ChatSummary, so the whole repo still typechecks. The header now says plainly that the field-by-field check is a hand check that nothing enforces, and that it has been wrong before. This package ships separately and cannot import from core, so an honest caveat is the most the file can offer — but a reader re-aligning it should know the claim is not a guarantee.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
types/openwa.d.tsstates it was "verified field-by-field" against six core files at v0.14.0. A member-level diff finds six fields it does not carry — and none of them annotated, which is how this file marks every other thing it deliberately leaves out.IncomingMessageephemeralDuration,call,backgroundColor,fontChatSummarykindConversationSendEnvelopelinkPreviewFour of the six predated the v0.14.0 alignment by several minor versions. So this was not a vendored copy lagging a moving host — they were missed.
Why it matters despite nothing being broken
Nothing failed: a plugin needing one of these could cast around the type. The cost is the thing a vendored contract exists to prevent — discoverability.
The author of a status-relay plugin has no way to learn that
backgroundColorandfontare on the payload. The author of a link-relaying plugin has no way to learn aboutlinkPreview, which on Baileys is the difference between a rich preview and a bare URL, because Baileys only generates one when the flag istrue.ChatSummary.kindis requiredIt is required in core, and it is required here. Nothing in the repo constructs a
ChatSummary—chatwoot-adaptercasts the engine result — so the whole repo still typechecks.The attestation itself
The header now says plainly that "verified field-by-field" is a hand check that nothing enforces, that it has been wrong before, and that a re-alignment must diff member by member and annotate anything left out — so a future reader can tell an omission from a decision.
This package ships separately and cannot import from core, so an honest caveat is the most the file can offer. It is still better than a claim that reads like a guarantee.
Verification
npm run typecheck(tsc --noEmit, whole repo) clean, 548 tests passing, catalog gate up to date.