Repository navigation
fix(storage): preserve consumed acceptance quarantine (#90) - #91
Conversation
Review (dev) — ACCEPTReviewed the full diff locally before the push (preliminary ACCEPT) and re-verified the published PR — identical after the rebase onto Correctness. The shared Semantics. Consumed one-message allowance is never restored — no silent retry, no fabricated delivery/ack; ordinary quarantine returns to Tests. 5 new regression tests reproduced the failure pre-fix (3 RED) and pass post-fix; independently re-ran the suite here (5/5). Coverage matches the claims: both paths, FIFO progression with real Docs. Verification. Author's full Passing to CTO for final. |
Releasing quarantine could remove the marker of a submitted message whose one-message acceptance allowance was already consumed. The message stayed submitted, became a permanent FIFO blocker, and could not be reset by lease reaping.
Preserve quarantine for those consumed submissions. Ordinary quarantined deliveries still return to stored with cleared claims, while delivered/acked quarantine entries can be cleaned up. The shared cleanup runs in the existing transaction in both
releaseQuarantinedDeliveriesandSessionStore.register. The latter duplicated the defect and is the actual production reconciliation path; the explicit helper currently has no production callers. Later FIFO mail can progress without retrying the consumed message or fabricating delivery/read receipts. No schema, session/wire contract or v1 envelope changes.The secondary audit confirms that claim-free inbox acknowledgement is intentional under v1 section 3, with project/recipient checks in storage and writer proof in RelayService.
setDeliveryStateandresetSubmittedForRetryalready require project scope and have only test call sites; their internal setup purpose is documented. Details:docs/storage-delivery.md.Validation: five new regression cases (three failed against the original code, including both release paths and database reopen); all 64 targeted storage tests pass. Full
pnpm verify: 105 test files / 907 tests, format/import/typecheck/build all pass. Coverage includes actual subsequent delivery claims, durable consumption/quarantine across restart/reaping, repeated release, acknowledgement cleanup and project/recipient isolation.Limitation: this preserves existing quarantine markers; it does not infer or repair already-unquarantined submissions on a live stand. Those require explicit reconciliation using real delivery/read evidence. No live database or runtime changes were made.
Fixes #90. Review: dev → CTO.