Skip to content

feat(inbox): wire CL-7238 mail id read-back through the real adapter - #729

Closed
TheGreatAxios wants to merge 3 commits into
cl-7238-atomic-deliverfrom
cl-7238-adapter-wiring
Closed

TheGreatAxios wants to merge 3 commits into
cl-7238-atomic-deliverfrom
cl-7238-adapter-wiring

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

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

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.
@linear-code

linear-code Bot commented Sep 15, 2026

Copy link
Copy Markdown

CL-7238

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.

1 participant