Skip to content

fix(messages): offer Retry as soon as a send fails - #3080

Merged
matt2e merged 1 commit into
mainfrom
could-not-send-1
Nov 9, 2026
Merged

matt2e merged 1 commit into
mainfrom
could-not-send-1

Conversation

@matt2e

@matt2e matt2e commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

What the user saw

When the relay refused a plain-text send, the message row stayed silent for about ten seconds and only then showed a small Retry. The relay actually answers in about 50 ms, so the user had no idea the message had failed until the ten-second delivery grace ran out.

The fix

deliveryFeedback applied the 10 s delivery grace (measured from created_at) to every non-seen state, failed included. The grace exists to hide uncertainty, and a failed send is not uncertain: every path to failed (relay refusal, rate-limited PublishNotSent, HTTP refusal, pre-publish error) proves the message was not delivered, while a transport error mid-publish becomes unknown.

The grace check now applies only when delivery !== "failed". sending, accepted and unknown still wait ten seconds from the message timestamp. A failed send restored after a reload shows Retry at once. DeliveryNotice needs no change: a new row re-renders it, and its grace timer is harmless for failed rows.

The guard is keyed on the delivery state rather than the outbox item's refused flag, which never reaches ChannelMessage, is dropped on reload, and is not set for rate-limit refusals.

Before and after

"Lunch at 12?" is sent in #Alpha in both panels at the same moment and the relay refuses it as rate-limited. The overlay clock counts from pressing Enter.

Relay refused Retry visible
Before (main 58116b8) 0.06 s 9.23 s
After (fix) 0.06 s 0.06 s
side-by-side.mp4

Before pressing Enter: both panels hold "Lunch at 12?" in the composer

Enter + 8.5 s: both relays refused at 0.06 s, but only the right-hand (fixed) row shows Retry; the left row is still quiet

Docs

  • docs/shell-design.md: the delivery rule now says failed sends show Retry immediately and only unconfirmed sends wait about ten seconds.
  • docs/buzz-help.md: same rule in the bundled help.

Verification

  • src/features/messages/delivery.test.ts: narrows the ten-second quiet case to unconfirmed states and adds a failed-inside-the-grace case.
  • src/features/messages/DeliveryNotice.test.tsx: rerenders a row inside the grace as sending, failed, then unknown and expects no status, Retry, then no status.
  • Both new tests failed before the fix and pass after it.
  • tsc --noEmit and Biome are clean.

Scope

This is PR 1 of three independent changes from the refused-send note (the other two are the sidebar unsent marker and keeping failed sends out of previews). #2229 touches DeliveryNotice.tsx only in canRetry (an imported-row guard) and leaves the grace alone, so there is no conflict.

🤖 Generated with Claude Code

@matt2e
matt2e marked this pull request as ready for review November 9, 2026 11:29
@matt2e
matt2e requested a review from a team as a code owner November 9, 2026 11:29

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord’s automated source review via Wes’s account, with independent Rocket, Mantis and Groot coverage.

No actionable findings in this change. The failed-only grace exemption preserves the existing ten-second delay for sending/accepted/unknown states and leaves confirmed messages quiet. Retry keeps the original event identity, and the outbox preserves earlier uncertain/accepted evidence across later refusals. The added controlled-clock unit and component assertions target the original regression; the help and shell-design updates match the behavior.

Reviewed head cd47b506f0df558c1c70b744de681978b99be780 against target base/merge-base 58116b826171d190a7376fc57b0509c32c507dde.

Source-only review: no tests, builds or app runs performed. Both screenshots and the description were inspected; the attached video was not. Live screen-reader, native and responsive behavior remain unverified. The hosted snapshot has passing JavaScript/browser jobs, but Rust and tool integration and CI required failed, and Windows validation was skipped; failure causality was not investigated. This is not an approval or a claim of passing CI.

When the relay refuses a plain-text send it answers in about 50 ms, but
the message row stayed quiet until `created_at + 10 s` and only then
showed Retry. `deliveryFeedback` applied the 10 s delivery grace to every
non-`seen` state, `failed` included.

The grace exists to hide uncertainty, and a `failed` send is not
uncertain: every path to `failed` (relay refusal, rate-limited
`PublishNotSent`, HTTP refusal, pre-publish error) proves the message
was not delivered, while a transport error mid-publish becomes `unknown`.
So the grace check now applies only when `delivery !== "failed"`.
`sending`, `accepted` and `unknown` keep waiting ten seconds from the
message timestamp; a failed send restored after a reload still shows
Retry at once. `DeliveryNotice` needs no change: a new row re-renders it,
and its grace timer is harmless for failed rows.

The `failed` guard is keyed on the delivery state rather than the outbox
item's `refused` flag, which never reaches `ChannelMessage`, is dropped
on reload, and is not set for rate-limit refusals.

Tests: `delivery.test.ts` narrows the ten-second quiet case to
unconfirmed states and adds a failed-inside-the-grace case;
`DeliveryNotice.test.tsx` rerenders a row inside the grace as `sending`,
`failed`, then `unknown` and expects no status, Retry, then no status.
Both new tests failed before the fix. `docs/shell-design.md` and
`docs/buzz-help.md` describe the new rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: mtoohey <mtoohey@squareup.com>

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the PR and went through the Nexus review-tracker notes. I did not see any P2-or-higher issues in this change.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

@matt2e
matt2e merged commit 21c44da into main Nov 9, 2026
111 of 113 checks passed
@matt2e
matt2e deleted the could-not-send-1 branch November 9, 2026 21:45
wpfleger96 added a commit that referenced this pull request Nov 9, 2026
…restricted-communities

* origin/main:
  ci: give WebKit shards headroom and keep fixture servers' idle connections open (#3074)
  fix(messages): offer Retry as soon as a send fails (#3080)
  fix(agents): link Settings from key failures and quote the provider (#3081)
  fix(identity): link Builderlab from Identity sync where its page holds the next step (#3082)
  fix(startup): show a recoverable screen when Buzz fails to open or crashes (#3085)
  fix(attention): ask before deleting a watch (#3092)
  fix(agents): remove the owner-access read tools (#3123)
  fix(channels): keep the side pane mounted under the image viewer (#3111)
  fix(solo): ask before Escape or Close drops a new workspace's typed fields (#3114)

# Conflicts:
#	docs/configuration.md
#	vite.config.ts
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.

3 participants