docs: spec — update dialog must never block work - #255
Open
oxedom wants to merge 1 commit into
Open
Conversation
Root-causes the "window doesn't close" report to the derived-open latch in app-shell.tsx:788-800, where handleUpdateLater() clears two of the three open-conditions and never touches hasPersistentUpdateState. Verified against the code: the trap is total, not partial. At restart-required the dialog renders zero forward actions, so the user gets a title telling them to restart and no way to do it. The two update mechanisms also share one status file, so on macOS the native box and the React dialog both fire, which is the likely shape of the report. Adds ADR-0002 recording that no update state may hard-lock the dialog. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Design spec only. No code changes.
The report
"When there is a new version update, the window doesn't close."
Root cause
app-shell.tsx:788-800derives the dialog's open state from three inputs:Every close path (
onOpenChange:1206-1212,onLater:1221) routes tohandleUpdateLater()(:718-729), which clearsupdateDialogOpenand recordsdismissedUpdateVersion— but never toucheshasPersistentUpdateState. Once the status isrestart-required(the normal state after a download), the second term staystrueforever and Later / X / Esc are all no-ops.What verification changed
The spec was written first and then checked line-by-line against the code. Four claims turned out to be wrong, and the reality is worse than the draft:
restart-requiredthe dialog has zero forward actions:update-summary.tsx:195explicitly hides "Update now" in that state,preload.cjs:44-127exposes no restart channel, andquitAndInstall()(main.cjs:607) is unreachable from the renderer. The user gets a title saying "Restart Cabinet to finish updating" and no way to do it.UpdateStatehas nine members, not seven (src/types/update.ts:7-16). Six latch.status-bar.tsx:777-795) — it just missesfailedand in-progress. This is an extension, not new work.electron/main.cjs:143andsrc/lib/storage/path-utils.ts:11write the sameDATA_DIR/.cabinet-state/update-status.json. On macOS,update-downloadedwritesrestart-requiredbefore showing the native box; the renderer polls, sees it, and latches the React dialog behind it. Dismissing the native box leaves the stuck one. This is the likely shape of the report.The fix
Dismissal keyed on version + state, so every state collapses to the existing non-blocking pill and a state change legitimately re-surfaces the dialog.
restart-requiredfailedsource-managedinstalls; packaged macOS returns 409).applyingmust not trap anyone.Follow-ups flagged (not fixed here)
autoUpdater.on("error")writesfailed(main.cjs:569-577) on any updater error, including routine unsigned/dev-build failures and transient network blips on the 4-hour check. That latches the dialog with no user action at all. Arguably the real bug.restart-requiredneeds a real action, not just dismissibility, or the pill points at nothing.See ADR-0002.
🤖 Generated with Claude Code