fix(sendqueue): surface, retry and discard stuck messages #9

Merged
jmz merged 1 commit from fix/sendqueue-wedged into release/mirus 2026-11-24 15:11:47 +00:00
Owner

Stacked on #8. Merge that first, then retarget this PR to release/mirus.

Problem. On 2026-11-15 a message got a non-JSON 403 from Cloudflare. matrix-sdk marked it wedged, and it then silently held back every later message in that room, across restarts: 36 messages in two chats over 8 days. iamb showed the error once and had no way to retry or drop it. Separately, matrix-sdk pauses a room's queue after any send error, and iamb never resumed it, so a single network blip stalled the room until restart.

Changes

  • Failed local echoes render red and struck through, including ones restored from a previous session.
  • Transient errors resume the room queue with exponential backoff (5 s doubling, capped at 5 min; reset on success).
  • :unsent shows the failed and waiting counts with reasons. :unsent retry unwedges and resumes. :unsent[!] discard [all] drops the failed messages (or every queued one) and asks for confirmation unless ! is given. Tab completion and the man page are included.
  • Cancelled local echoes are removed from the timeline (they used to stay visible).

Verified

  • Unit tests: command parsing, completion, backoff. Full suite: 214 pass, clippy clean, nightly rustfmt.
  • Live, in a throwaway private room: a planted wedged message and a queued one show the correct styling; :unsent reports the reason; retry sends both in order; discard (with confirmation) drops the failed one and the queued one goes out.
  • Not exercised live: the automatic backoff after a real transient error.

🤖 Generated with Claude Code

Stacked on #8. Merge that first, then retarget this PR to `release/mirus`. **Problem.** On 2026-11-15 a message got a non-JSON 403 from Cloudflare. matrix-sdk marked it wedged, and it then silently held back every later message in that room, across restarts: 36 messages in two chats over 8 days. iamb showed the error once and had no way to retry or drop it. Separately, matrix-sdk pauses a room's queue after *any* send error, and iamb never resumed it, so a single network blip stalled the room until restart. **Changes** - Failed local echoes render red and struck through, including ones restored from a previous session. - Transient errors resume the room queue with exponential backoff (5 s doubling, capped at 5 min; reset on success). - `:unsent` shows the failed and waiting counts with reasons. `:unsent retry` unwedges and resumes. `:unsent[!] discard [all]` drops the failed messages (or every queued one) and asks for confirmation unless `!` is given. Tab completion and the man page are included. - Cancelled local echoes are removed from the timeline (they used to stay visible). **Verified** - Unit tests: command parsing, completion, backoff. Full suite: 214 pass, clippy clean, nightly rustfmt. - Live, in a throwaway private room: a planted wedged message and a queued one show the correct styling; `:unsent` reports the reason; `retry` sends both in order; `discard` (with confirmation) drops the failed one and the queued one goes out. - Not exercised live: the automatic backoff after a real transient error. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(sendqueue): surface, retry and discard stuck messages
Some checks failed
nix / eval (pull_request) Failing after 3m2s
check / check (pull_request) Successful in 10m28s
ff15467e58
A message that failed with an unrecoverable error (e.g. a non-JSON 403
from a proxy) was marked wedged by matrix-sdk and silently held back
every later message in the room, across restarts. Transient errors also
paused the room's queue with nothing to resume it until a restart.

- Show failed local echoes in red, struck through, including ones
  restored from a previous session.
- Resume a room's queue after transient errors with exponential backoff
  (5s doubling, capped at 5 min).
- Add `:unsent [retry | discard [all]]` to inspect, retry or drop the
  room's unsent messages (discard asks for confirmation unless `!`).
- Remove cancelled local echoes from the timeline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jmz force-pushed fix/sendqueue-wedged from ff15467e58
Some checks failed
nix / eval (pull_request) Failing after 3m2s
check / check (pull_request) Successful in 10m28s
to b8afa9c110
All checks were successful
nix / eval (pull_request) Successful in 4m36s
check / check (pull_request) Successful in 12m5s
2026-11-24 14:58:55 +00:00
Compare
jmz changed target branch from sync/upstream-2026-11 to release/mirus 2026-11-24 15:11:43 +00:00
jmz merged commit b8afa9c110 into release/mirus 2026-11-24 15:11:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/iamb!9
No description provided.