Repository navigation
fix(dashboard): keep a confirmed close retry from showing a false still-open notice - #31299
Conversation
1643b0a to
28b9aa4
Compare
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. This is a store-only change: it adds no strings and no components, and it changes no control. It only stops a false "still open" notice from showing after a confirmed retry. No screenshot is needed. [UX-REVIEWED] d5f266a Description read[DESCRIPTION-READ] b6672e8e90793c369460fd2e8632809fa68515acbae9e4f92fa6cbc91c95c343 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix changes the state the late callback reads, and the type move is forced by the 2,000-line cap ( What this change shipsInventory (4 items) — 4 justifiedIntent: when a user retries a close and the server confirms it, they never see a false "close didn't go through" notice. FIX (#31169).
[FIRST-PRINCIPLES-REVIEWED] d5f266a Description read[DESCRIPTION-READ] 3c7dadf05fcb17031c8cf1a4fd7ccc675f1bc116ef68e688b47e0a9fb9123769 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. A per-key confirmation count that outlives the hold is the right fix for a reader whose state the same reducer pass deletes. The change is store-only and reversible. Notes
[DESIGN-REVIEWED] d5f266a Description read[DESCRIPTION-READ] e5d5952a01e5c309a0531927811099512d662bd1fdc75f35ff696c3e1ef43270 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
28b9aa4 to
0051b08
Compare
|
self-added: yes
|
0051b08 to
d5f266a
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: dashboard store fix that counts confirmed closes per key, so a late failure of an earlier close attempt no longer reports a confirmed retry as still open; the CloseHold type moves to its own module unchanged.
Problem / Motivation
Goal: A close the user retried and the server confirmed never shows the "the close didn't go through" notice.
A close fails with no server code (a 504, a dropped connection). The user presses close again, and that retry works. Then three or more slot-list pushes arrive before the first close's recovery list answers. When that answer lands, the user sees a false "still open" notice for a session that is gone. The row itself stays hidden.
Why it matters
The notice tells the user to try again on a session that is already closed. That is the same false notice #30466 fixed, on a rarer path.
Not a goal
What changed (motivation → approach → change)
The first close decides its notice after its recovery list settles. It skipped the notice when it found a confirmed hold for the key. But the retry's hold ends in the same reducer pass that settles that recovery list: the pushes have spent its list budget, and the recovery list was the last one it waited on. So the check found no hold.
Now the store counts, per key, how many closes reached the confirmed phase (
closeConfirmationsindashboardSlice.ts). The count outlives the hold. Each close reads the count when it starts, and a failed close reads it again when its recovery list settles. If the count moved, a newer close was confirmed, and no notice shows. Reading it at the start also covers a retry that is confirmed while the first close's DELETE is still waiting.The
CloseHoldtype moves towebsite/src/store/dashboard/closeHold.ts, unchanged, sodashboardSlice.tsstays under the 2,000-line cap.Backwards compatibility
Compatible: the store gains one counter map; no action, prop or wire format changes.
Removes nothing: the notice check reads a counter in place of the hold, and every case the hold check suppressed also bumps the counter.
Tests
website/src/test/ChatSlice.uncodedClose.test.tsx:a rejected recovery read does not report a confirmed retry as refused after its list budget is spent: a failed close, a confirmed retry, three pushes, then the recovery read fails. Fails on main with the notice shown; passes with the fix.a late uncoded failure does not report a retry confirmed after the first hold expired: the first DELETE stalls past its 30 s hold, a retry is confirmed, then the first DELETE fails with a 504 and its recovery read fails. Fails if the count is read when the close fails; passes when it is read at the start.a pre-close recovery list does not report a confirmed retry as refused after its list budget is spent: the same race when the recovery list answers with the old row. Passes on main and with the fix; it guards the resolved branch.Proof: not provable -- frontend test (prove.py runs Python only)
By hand: with main's
chatSlice.tsswapped in, the list-budget test fails (expected { key: 'doomed', … } to be null). With the count read at failure time, the hold-expired test fails. With the fix, all 12 pass in 10 shuffled runs (--sequence.shuffle, seeds 1 to 10).Manual verification
N/A — unit coverage sufficient: the race needs a timed 504 plus three server pushes, which the store tests drive exactly.
Screenshots / video
Why no screenshot: store logic only; the notice and the sidebar render the same way, and only when the notice shows changes.
Related Issues
Closes #31169
Sibling sweep
Swept: git grep -nE "closingSlots?*.[|closingSlots[" -- website/src
Sibling: website/src/app-sdk/ChatPanel.tsx:40 -- not affected -- reads the hold live at slot change, not after a fetch settles
Sibling: website/src/apps/papyrus/CoAuthorPanel.tsx:72 -- not affected -- a selector that re-renders on every hold change
Sibling: website/src/pages/chat/page/sessionsDrawer.ts:382 -- not affected -- reads the hold live when the active slot moves
Pattern harvest
Rule candidate: review-prompt
Pattern: a late callback reads short-lived reducer state that the same action that triggers the callback may delete
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)