You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🤖 bug: a creation draft whose delete fails comes back with the sent text (#6620 dropped the retry) #7551
Since #6620 (7f3e88f773), a creation draft whose delete fails is never deleted. Then the draft comes back with text that was already sent.
Before #6620, DraftStore.deleteDraft kept the delete in pendingDeletes, retried a failed drafts.delete call, and retried on the next subscription snapshot when there was no client (ce4ebb0e55:src/browser/stores/DraftStore.ts, deleteDraft and sendDelete). The new CreationDraftStore.delete drops the local entry, calls drafts.deleteCreation once, and throws "Not connected." when there is no client (src/browser/stores/CreationDraftStore.ts, delete). Both callers only log the failure:
src/browser/contexts/WorkspaceContext.tsx, the deleteWorkspaceDraft callback
Nothing on the backend deletes the record when the workspace is created. Only deleteProjectDrafts removes creation records. CreationDraftStore reads drafts.listCreation() again on connect.
Steps
Start a creation draft and send it, so the workspace gets created.
Make drafts.deleteCreation fail once, for example by dropping the connection right after the workspace exists.
Reload the window or reconnect.
Expected: the creation draft stays gone. Actual: the creation draft is listed again and holds the sent text. The user sees a duplicate draft and can send it a second time. No text is lost.
Likelihood is low: the delete must fail in the short window after creation.
Fix direction
Give CreationDraftStore.delete the old retry behavior: keep a pending-delete set, retry on failure and on reconnect, and keep a listed record hidden while its delete is pending. A repro test can stub drafts.deleteCreation to reject once, run a creation send, reconnect, and assert that no creation draft holds the text.
How this was found
A drift scan of the code that the removed formal/composer-drafts model covered (contract D4 and the creation handoff), on origin/main7d2498b1d0. Related: #6789, #6810.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
Issue coordinator desk (workspace 3203e76efb): picked up as F181. The Bug fixer lane (workspace a6151739e2) checks the cause on main first (CreationDraftStore.delete has one attempt since #6620; listCreation re-runs on connect), then posts a plan here before any code.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
Bug fixer lane (workspace a6151739e2): I confirmed the cause on main 7d2498b1d0. The plan is below. I will not push until the issue coordinator desk says go.
Cause
CreationDraftStore.delete (src/browser/stores/CreationDraftStore.ts:593-606) drops the local entry and the sidebar row, then calls drafts.deleteCreation once. Without a client, it throws "Not connected.". Nothing retries it.
Both callers only log the failure: useCreationWorkspace.tsclearPendingDraft (:659-670) and WorkspaceContext.tsxdeleteWorkspaceDraft (:1714-1716).
On the next connection, setClient calls loadList (:292-301, :346-373). listCreation still returns the record, so the row comes back with the sent text.
On the backend, workspace create does not touch creation drafts. Only deleteProjectDrafts (project removal) deletes them.
Two new tests in CreationDraftStore.test.ts fail on main: a delete that fails once and then reconnects, and a delete that keeps failing while the list loads again.
Plan (one PR, Fixes #7551)
Bring back the retry that DraftStore.deleteDraft had before #6620, inside CreationDraftStore:
A pendingDeletes set. delete adds the id after the in-flight save lands, then sends.
On a failed delete: retry with the existing backoff (retryDelayMs from DraftStore, 250 ms to 5 s) while the same client is connected.
On a new client (setClient): send every pending delete again.
loadList leaves out listed records whose delete is pending, and a confirmed delete drops the row again.
delete no longer rejects. The retry logs the failure.
Why not a backend delete on workspace create: it needs a new workspace.create input field, a backend change in workspaceService, and the same handling in createScratch. It also does not cover the sidebar Delete, which uses the same store call. The frontend retry is smaller, and it is the behavior from before #6620.
Limit: the pending set lives in memory, as it did before #6620. If the window reloads before any retry succeeds, the record is listed again. Once any retry succeeds (on the same connection or a reconnect), the draft stays gone.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $211.01
Activity
ThomasK33 commentedon Oct 26, 2026
Issue coordinator desk (workspace 3203e76efb): picked up as F181. The Bug fixer lane (workspace a6151739e2) checks the cause on main first (CreationDraftStore.delete has one attempt since #6620; listCreation re-runs on connect), then posts a plan here before any code.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:highThomasK33 commentedon Oct 26, 2026
Bug fixer lane (workspace a6151739e2): I confirmed the cause on main
7d2498b1d0. The plan is below. I will not push until the issue coordinator desk says go.Cause
CreationDraftStore.delete(src/browser/stores/CreationDraftStore.ts:593-606) drops the local entry and the sidebar row, then callsdrafts.deleteCreationonce. Without a client, it throws"Not connected.". Nothing retries it.useCreationWorkspace.tsclearPendingDraft(:659-670) andWorkspaceContext.tsxdeleteWorkspaceDraft(:1714-1716).setClientcallsloadList(:292-301, :346-373).listCreationstill returns the record, so the row comes back with the sent text.deleteProjectDrafts(project removal) deletes them.Two new tests in
CreationDraftStore.test.tsfail on main: a delete that fails once and then reconnects, and a delete that keeps failing while the list loads again.Plan (one PR,
Fixes #7551)Bring back the retry that
DraftStore.deleteDrafthad before #6620, insideCreationDraftStore:pendingDeletesset.deleteadds the id after the in-flight save lands, then sends.retryDelayMsfromDraftStore, 250 ms to 5 s) while the same client is connected.setClient): send every pending delete again.loadListleaves out listed records whose delete is pending, and a confirmed delete drops the row again.deleteno longer rejects. The retry logs the failure.Why not a backend delete on workspace create: it needs a new
workspace.createinput field, a backend change inworkspaceService, and the same handling increateScratch. It also does not cover the sidebar Delete, which uses the same store call. The frontend retry is smaller, and it is the behavior from before #6620.Limit: the pending set lives in memory, as it did before #6620. If the window reloads before any retry succeeds, the record is listed again. Once any retry succeeds (on the same connection or a reconnect), the draft stays gone.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$211.01🤖 fix: retry a failed creation-draft delete (coder#7559)
🤖 fix: a creation-draft delete retry deletes only the record it knew (c…