feat(inbox): wire CL-7238 mail id read-back through the real adapter - #729
Closed
TheGreatAxios wants to merge 3 commits into
Closed
TheGreatAxios wants to merge 3 commits into
TheGreatAxios wants to merge 3 commits into
Conversation
Fault-injection tests: a throw between the mail write and the dispatch enqueue leaves a committed mail row whose redelivery dedupes, so the dispatch row is never queued. No src change; the two repair tests fail.
deliverNotification now resolves pre-existing mail ids through an optional host read-back and enqueues dispatch for them; the dispatch store dedupes by (mail row, sink), so the repair never double-queues. Without the read-back a crash-window redelivery still loses the dispatch (pinned by test); the inbox adapter owns that wiring.
TheGreatAxios
force-pushed
the
cl-7238-atomic-deliver
branch
from
September 15, 2026 21:12
1213752 to
bd4ed60
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary: wires PR #717's optional ResolveExistingMailIds at the inbox adapter. createResolveExistingMailIds(db) resolves pre-existing mail rows by the mailbox unique mail key (mailboxKey.inbox(source, externalId), the same key deliverInboxItems dedupes on), so a redelivery after a crash between mail write and dispatch enqueue repairs the missing dispatch rows instead of losing them. Adds an end-to-end crash-window test through the real adapter against real Postgres: first attempt commits mail then dies before dispatch enqueue, redelivery queues exactly the missing dispatch, and a further redelivery holds dispatch to one row.
Verification: new e2e test red-probed (0 dispatch queued with the read-back unwired) then green; packages/inbox suite 52 pass 0 fail; packages/notify suite 35 pass 0 fail; repo typecheck exit 0; repo lint 0 errors (10 pre-existing settings-ui warnings).
Related to CL-7238