fix: reject OTKs on QR contact-code decode (#51) - #60
Conversation
SPK-only was an encoder policy; parsers still accepted OTK-bearing plaques and reintroduced multi-scan silent loss. Encode throws and decode returns null when n !== 0. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Reviewed the substance and I agree with it. Holding merge only because the branch is conflicting — The fixMaking SPK-only a wire rule rather than an encoder policy is the right instinct, and the distinction is the whole point of the issue. Worth being precise about what this does and does not buy, since the issue title reads scarier than the actual threat:
Backward compatibility checked: every v2 code we have ever emitted has One observation, not a change request
I think throwing is the correct choice here and I would not change it: silently emitting a plaque that will eat other people's messages is strictly worse than a crash we would notice in testing. Just flagging that the safety of it rests on Test noteThe hand-crafted |
CI's `npx expo install --check` started failing after upstream SDK 57 patch bumps (expo ~57.0.8 and related packages). Co-authored-by: Cursor <cursoragent@cursor.com>
Lock @napi-rs/wasm-runtime's @emnapi/core and @emnapi/runtime peers at the top level so CI's npm ci does not demand an unlocked 1.11.2. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
5c14435 to
1d2f720
Compare
Summary
encodeBundle/decodeBundleenforce SPK-only (n must be 0).decodeContactCode.bundleFromWirestill carries OTKs).Test plan
npm test/npm run typecheck