Skip to content

fix(dashboard): keep a confirmed close retry from showing a false still-open notice - #31299

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/close-retry-false-notice-31169
Nov 6, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/close-retry-false-notice-31169

Conversation

@rnoack1

@rnoack1 rnoack1 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Changing how long a close hold lives or which lists it hides.
  • Changing the notice for a close that really failed.

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 (closeConfirmations in dashboardSlice.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 CloseHold type moves to website/src/store/dashboard/closeHold.ts, unchanged, so dashboardSlice.ts stays 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.ts swapped 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@rnoack1
rnoack1 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 09:02
@rnoack1
rnoack1 requested a review from Zedmor November 6, 2026 09:02
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 6, 2026
@rnoack1
rnoack1 force-pushed the fix/close-retry-false-notice-31169 branch from 1643b0a to 28b9aa4 Compare November 6, 2026 10:10
@rnoack1

rnoack1 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Frontend Tests (4) on 1643b0a failed framerMotionMockStableTags on main's ChatSidebar.boardRenameOfflineScope.test.tsx, fixed on main by #31279.
Rebased onto 4a71d19 (same patch-id); the 8 lanes that hit the API rate limit re-run on 28b9aa4.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of d5f266a645648d849317729a7ccdea55c0a60a94 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of d5f266a645648d849317729a7ccdea55c0a60a94 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 (dashboardSlice.ts is at 1984 lines on head).

What this change ships

Inventory (4 items) — 4 justified

Intent: when a user retries a close and the server confirms it, they never see a false "close didn't go through" notice. FIX (#31169).

  1. A confirmed retry no longer shows the still-open notice after slot pushes have used up its hold's list budget — justified
  2. A retry confirmed after the first close's hold expired, while that close's DELETE is still pending, no longer shows the notice — justified
  3. The store keeps a new per-key count of confirmed closes, which outlives the hold (closeConfirmations, 1 consumer: deleteSlot) — justified
  4. The CloseHold type moves to store/dashboard/closeHold.ts unchanged — justified

[FIRST-PRINCIPLES-REVIEWED] d5f266a

Description read

[DESCRIPTION-READ] 3c7dadf05fcb17031c8cf1a4fd7ccc675f1bc116ef68e688b47e0a9fb9123769

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of d5f266a645648d849317729a7ccdea55c0a60a94 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The claim "every case the hold check suppressed also bumps the counter" is only true for confirmations that happen after this close starts. A confirmed hold that already existed when the close began used to suppress the notice. Now it does not, so a failed recovery read in that state would show the notice. Users rarely reach this, because the row is hidden while that hold is live. Name the case in the description or in a test.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed d5f266a645648d849317729a7ccdea55c0a60a94 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d5f266a

Verdict parsed from the review's SHA-scoped output markers for commit d5f266a645648d849317729a7ccdea55c0a60a94.

False positive or not applicable? A repository writer can comment:
/ai-review override fable d5f266a645648d849317729a7ccdea55c0a60a94 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of d5f266a645648d849317729a7ccdea55c0a60a94 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d5f266a

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d5f266a645648d849317729a7ccdea55c0a60a94 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 6, 2026
@rnoack1
rnoack1 force-pushed the fix/close-retry-false-notice-31169 branch from 28b9aa4 to 0051b08 Compare November 6, 2026 10:40
@rnoack1

rnoack1 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: confirmation counter baseline read in deleteSlot

  • span=52a4927c3548 Failure-time snapshot misses an already-confirmed retry

fixed in d5f266a: deleteSlot reads closeConfirmations[key] when the close starts, so a retry confirmed during a stalled DELETE moves the count.
Test "a late uncoded failure does not report a retry confirmed after the first hold expired" fails with the failure-time read and passes now.

@rnoack1
rnoack1 force-pushed the fix/close-retry-false-notice-31169 branch from 0051b08 to d5f266a Compare November 6, 2026 10:53
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 6, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 6, 2026 16:03

@KiroCrewCaptain KiroCrewCaptain 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.

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.

@KiroCrewCaptain
KiroCrewCaptain merged commit 16baf71 into main Nov 6, 2026
96 of 112 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/close-retry-false-notice-31169 branch November 6, 2026 16:05
bolichen97 pushed a commit that referenced this pull request Nov 9, 2026
…ll-open notice (#31299)

(cherry picked from commit 16baf71)

Backport note: dashboardSlice.ts keeps release/0.12.0's `export { selectPersonSlots }` line; main's adjacent `selectLiveMateThreads` export comes from #30220, which is not on release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard: a confirmed close retry can still show a false 'still open' notice when list pushes race the old recovery reply

2 participants