Repository navigation
fix(api): stop uncertain neutral sends spinning as Sending - #525
Merged
Merged
Conversation
When a neutral-path send ended with an unknown outcome - the provider call failed in a way that may still have delivered it, or the dispatch lease expired - the intent became uncertain but its message was never touched and no realtime update went out. Nothing re-claims an uncertain intent, so the message showed "Sending" for ever. Mark such a message the way the legacy path does: it stays pending (it may have been delivered, so it is neither retried nor failed) with metadata.error = send_outcome_unknown, and a realtime fanout tells the browser. A message a receipt already moved past pending is left alone. Lease recovery also ran only at startup, so an intent whose dispatcher died inside its lease stayed dispatching; it now also runs from the poll loop once per lease period. The message formatter now passes metadata.error to the client, so the amber unconfirmed mark also survives a reload. Fixes #381
setkyar
force-pushed
the
fix/outbound-uncertain-status
branch
from
November 23, 2026 18:03
aa1b773 to
77ab8e4
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.
Fixes #381.
Problem
A send on the neutral (channel-spine) path can end with an unknown outcome: the provider call failed in a way that may still have delivered it, or the dispatch lease expired. The intent then became
uncertain, but its message row was never updated and no realtime update went out. Nothing ever picks up anuncertainintent again, so the message showed "Sending" forever.Lease recovery also ran only at startup. An intent whose dispatcher died during its lease stayed
dispatchinguntil the next restart.Fix
pending(it may have been delivered, so it is neither retried nor failed) withmetadata.error = send_outcome_unknown, and a realtime fanout tells the browser, which shows the amber "unconfirmed" mark.pendingis left alone.metadata.errorto the client, so the amber mark survives a reload.Tests
channel-outbound-uncertain.integration.test.ts: the message is marked unconfirmed when the provider outcome is uncertain, and when a dispatch lease expires (including after startup, from the poll loop). A message a receipt already moved pastpendingis not marked.message-formatters.test.ts: the stored error code reaches the client without the internal detail, and a message without an error gets none.main. Typecheck, biome and both suites pass on a fresh Postgres 18.Release
No migration.
worker: skip.