-
Notifications
You must be signed in to change notification settings - Fork 14
feat(events)!: move to bridge 0.10.0 and deliver the events it added #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2c5e6b6
chore(deps): take the bridge 0.8.0 reader and numeric contracts
claude 81c9cd8
fix(proto): put back the two inputs the bridge codec stopped accepting
claude 42b2138
fix(proto): absorb the bridge 0.8.0 strictness at the send path too
claude be9a4c6
fix(types): keep 64-bit fields declared as upstream declares them
claude ed4aafb
test(fuzz): frame a mutated payload with the schema, as wire.ts requires
claude 2d3a9dc
chore(deps): bridge 0.8.1, and document the merge it made conformant
claude 5f31eb4
test(fuzz): let the merge entry cover the repeated fields it also gov…
claude c0c140b
Merge remote-tracking branch 'origin/main' into chore/bridge-0.8.0
jlucaso1 08d6cd5
feat(events): move to bridge 0.10.0 and deliver the events it added
jlucaso1 e2e8c89
test(fuzz): scope the merge entry to payloads that were concatenated
claude c1ba9a3
test(fuzz): tie each allowlist entry to the difference it documents
jlucaso1 20cea47
test(fuzz): record the renamed favicon field where the harness alread…
jlucaso1 651c9bc
feat(events): deliver the link-preview setting and the pair-code failure
claude 1e67bc3
fix(fuzz): read bridge field numbers, and drop the allowlist members …
claude d7e6f4d
test(fuzz): pin the lying-length entry to the salvage it documents
claude 6032d89
test(fuzz): degrade a contested field number rather than framing agai…
claude 90d07fd
fix(fuzz): read the merged repeated field as a suffix, and repair at …
claude b369a76
style: format the repair walk
claude a8b25f2
test(fuzz): require the substitution itself, and never let it stand a…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { encodeProto } from '@oxidezap/whatsapp-rust-bridge' | ||
| import { repairProtoMessage } from './proto-runtime.ts' | ||
|
|
||
| /** | ||
| * `encodeProto`, with the two inputs the bridge codec stopped accepting put back. | ||
| * | ||
| * From 0.8.0 the codec refuses an empty string where the schema declares a | ||
| * 64-bit integer, and an unpaired surrogate in a text field. Both were written | ||
| * before — as `0` and as U+FFFD — and upstream Baileys still encodes both, so a | ||
| * message that used to reach the server would now throw in the caller's face. | ||
| * This is where that is absorbed, so the strict contract stays true of the | ||
| * bridge and the tolerant one stays true of this library. | ||
| * | ||
| * Repair on failure rather than check on write: the ordinary encode is exactly | ||
| * the call it was before, with no scan of any field, and the repair runs only | ||
| * for a message that was already going to throw. `encodeProto` returns finished | ||
| * bytes rather than a lazy writer, so one try/catch covers it. | ||
| */ | ||
| export const encodeProtoCompat = (path: string, message: unknown): Uint8Array => { | ||
| try { | ||
| return encodeProto(path, message) | ||
| } catch (error) { | ||
| const repaired = repairProtoMessage(path, message) | ||
| // Reference equality: nothing was coerced, so the failure is something this | ||
| // does not explain — an unmodelled type, a number no int64 can hold — and | ||
| // it has to keep propagating rather than be retried into a second throw. | ||
| if (repaired === message) throw error | ||
| return encodeProto(path, repaired) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.