Repository navigation
Conversation
…ke its write race-safe A `queue_push` that beat its own HTTP receipt had its broadcast text overwritten, breaking cancel on a redacted entry; an edit left the record describing text the queue no longer held.
Design Review (Opus 5.5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS
Watch
[DESIGN-REVIEWED] bf96918 Description read[DESCRIPTION-READ] 041683120aa9421a957dfb77af971420e6b2f93b5d00d0734fa50fcb8200bd0b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Check by hand that cancelling an edited queued message brings back its attachment chips in the composer. The unit tests only cover the stash records. [UX-REVIEWED] bf96918 Description read[DESCRIPTION-READ] 72e46c5d5d0d404f74bd0e41193f229efb4ebd86bd2f47fd58d344708212f5ed That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK The receipt-write guard in Not justified as shipped
What this change shipsInventory (5 items) — 1 justifiedIntent: cancelling a queued message, even one that was edited, restores the text and attachments the user sent. FIX.
Blockers
[FIRST-PRINCIPLES-REVIEWED] bf96918 Description read[DESCRIPTION-READ] c87dc44932a208dd56b0421e89f9cc19b84c5e24709d6d7070849ed1667050f6 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — 🔴 changes requested (blocking)Reviewed Blocks merge: a cancel after an edit puts the card's wire-format text, with its attachment markers and quote block, back into the composer. BLOCKING — website/src/utils/queuedSendStash.ts:293 |
GPT 6.1 Review (fork) — 🔴 changes requested (blocking)Reviewed 2 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- website/src/utils/queuedSendStash.ts:100 -- Cancelling an edited entry duplicates its serialized quote and attachments BLOCKING -- website/src/utils/queuedSendStash.ts:97 -- A spaced filename revives an attachment removed by the edit [BLOCK-MERGE] bf96918 Adjudication (Opus 5.5) — is blocking on each finding proportionate?Both fenced findings stay blocking. Neither depends on implausible conditions, so I can't FLAG either one.
|
Problem / Motivation
Goal: Cancelling a queued message puts back exactly what the user sent, attachments included, even when the server's broadcast beat its own receipt or the message was edited while queued.
Split out of #6825: the queued-send stash, carved apart from the persisted recovery store because it is a separate in-memory mechanism.
The queued-send stash holds what the composer looked like at send time, so a cancel can restore it. Two paths leave it wrong today:
queue_pushcan arrive before the HTTP receipt for the same send. The receipt's write then overwrites the adopted record'ssent(the server's broadcast text) with the sender's un-redacted copy. The cancel guard comparessentagainst the card, the comparison fails on a redacted entry, and cancel falls back to the parser.The parser cannot recover an attachment path that contains a space, and it never had the attachments of a redacted entry, so in both cases the cancel restores the text without the files the user attached.
Why it matters
Cancelling a queued message is how a user takes it back to fix it. Losing the attachments on that path means the user has to find and re-attach files they already attached, and may not notice they are gone before resending.
Not a goal
sendId. It can only be adopted oncequeue_pushcarriessendId, which is a separate decision, so it is left for a later change.What changed (motivation → approach → change)
hooks/useQueuedMessageActions.tstoutils/queuedSendStash.ts, so the chat slice can reach it later without importing the hook, which would close an import cycle. The hook re-exports every name, so all existing importers are unchanged. The record's currentaliasesandquotefields are carried over exactly.stashQueuedSendwrites the receipt's record only when no record is stashed yet for that queue id. The three writers incomponents/useChatPaneSend.tsandpages/chat/page/composerSend.tsuse it in place of a raw.set.restashEditedSendwith the submitted text and the server's returned text. The record'srawbecomes what the user submitted, itssentwhat the card shows, and itsfilesdrop any attachment the edit removed. The removal test checks both ends of a path mention, so/tmp/report.pdfis not kept alive by/tmp/report.pdf.bak.Backwards compatibility
Compatible: every symbol the hook exported before is still exported from it with the same shape, and the record type is unchanged.
Removes nothing: the inline declaration in the hook is replaced by a re-export of the same store, so no reader loses access to it.
Tests
utils/queuedSendStash.pathBoundary.test.ts: an edit that drops an attachment prunes it from the stash, and a longer path sharing its prefix does not keep it alive.useQueuedMessageActions.test.tsx,ChatPane.draftRecovery.test.tsx,ChatPageW3Coverage.test.tsx) pass unchanged, which pins that the move kept the store's contract: 104 of 104.Wider sweep (
src/utils,src/hooks,src/test/ChatPane*,src/test/ChatPage*,src/test/QueueStack*): 2734 of 2734.tsc --noEmitandeslint --max-warnings 0are clean on every changed file.Manual verification
N/A for this draft: the receipt race and the edit re-stash are both pure store transitions, covered by the unit suites above.
Screenshots / video
Why no screenshot: this moves an in-memory store and changes how it is written, and nothing on screen renders differently.
Related Issues
Part of #6825.
Pattern harvest
Not generalizable: the overwrite is specific to a store written from two independently-ordered sources, and the fix is local to its one writer.
Checklist