fix: always try retained SPKs when opening sealed mail (#50) - #59
Conversation
|
Reviewed the substance and I agree with it. Holding merge only because the branch is conflicting — This has also become the gating PR of the three prekey fixes, which is not obvious from the issue, so writing down why. The fix is right
The cost is bounded and small: the SPK ring is at most Why this now gates #58On today's #58 removes that re-share loop (correctly — it is the #49 bug). The side effect is that the pool now pins at the ceiling. Measured on a local merge of #58 onto And with the pool at 24, a probe on that same tree: 24 OTKs + cap 28 leaves room for 4 SPKs out of a 6-key ring, so anything sealed to an SPK older than roughly 4 hours stops opening — inside the 6h window we advertise as retained. So #58 alone converts one silent-loss bug (#49) into a different one (#50). Landed together they fix both, and #58's own regression test still passes with this change in. So the order I want is: #59 rebased and merged → #58 → #60. Nothing in #58 needs to change; it just should not go first. I have said the same on that PR. Test noteThe split into two tests is right — the old one was asserting the cap and the pool ceiling in the same case and would have gone green for the wrong reason after this change. One nit for when you rebase: |
OPEN_SECRET_CAP now limits only the OTK walk. Slicing SPKs off behind a full OTK pool made in-flight SPK mail silently undeliverable. Co-authored-by: Cursor <cursoragent@cursor.com>
a03ea7a to
567cc91
Compare
|
Rebased onto latest Also tightened the #50 length assert to an exact equality after loading a known pool:
Tracking issue for the OTK-pool starvation / eviction #68 |
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>
Summary
secretsForOpen()caps newest OTKs atOPEN_SECRET_CAPbut always appends the full retained SPK ring.Test plan
npm test/npm run typecheck