Skip to content

fix: fence prekey persist against panic wipe race (#70) - #74

Open
chtnnh wants to merge 3 commits into
ni5arga:mainfrom
chtnnh:fix/70-panic-wipe-persist-fence
Open

fix: fence prekey persist against panic wipe race (#70)#74
chtnnh wants to merge 3 commits into
ni5arga:mainfrom
chtnnh:fix/70-panic-wipe-persist-fence

Conversation

@chtnnh

@chtnnh chtnnh commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds GenerationQueue so panic wipe can invalidate + drain in-flight persistPrekeys before wipeEverything.
  • Nulls identityRef / onPrekeysChanged at wipe start so periodic sync cannot start a fresh persist mid-wipe.
  • Wraps saveLocalPrekeys / savePeerPrekeys in withExclusiveTransactionAsync (same pattern as wipe).
  • Restores onPrekeysChanged after successful re-provision.

Closes #70

Test plan

  • npm test / npm run typecheck (GenerationQueue interleaving cases)
  • Manual: send/receive under load, panic wipe, confirm receive_keys / one_time_keys empty until fresh provision

chtnnh and others added 3 commits July 23, 2026 12:49
Invalidate and drain in-flight persistPrekeys before wipeEverything, and
wrap prekey table replaces in exclusive transactions so a stale snapshot
cannot resurrect wiped OTK/SPK secrets.

Co-authored-by: Cursor <cursoragent@cursor.com>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[High] Panic wipe can resurrect a wiped OTK secret through an unfenced persistPrekeys race

1 participant