Repository navigation
fix(update): separate downloading from restarting, and put the refusal in the action - #573
Merged
Merged
Conversation
…l in the action Closes #344, #569, #570. Three problems on one path, all of them about the app deciding something on the user's behalf at a moment nobody chose. ## The restart was not asked for installUpdate ended with an unconditional relaunch(), so a download finishing closed the app. Downloading and restarting are now separate: installUpdate stages the update and stops, and the status bar offers "Restart to finish update" for the user to take when they are ready. That is what VS Code and Slack do, and for the same reason — the download is harmless, the restart is the part that can lose work. There was no UI for the "downloaded" state at all, so a relaunch that failed or hung left the status bar showing nothing. ## The refusal lived in the button The checks for a running query and unsaved tabs were in the status bar's onClick. installUpdate itself had none. One caller today, but nothing said the next one had to bring its own — the same shape as the grid's save path before #529. Worse, they ran once, at the click, before a download that can take minutes, and the restart then happened against a state nobody had looked at since. A query started or a tab edited during the download was destroyed by a restart authorised before either existed. updateBlockers lives in src/lib/update-guard.ts, so both moments can ask without the settings store having to know about queries or editor tabs. It is checked before the download and again before the restart. It reports every reason rather than the first, so fixing one does not walk into the next. ## A failed install left the status bar lying installUpdate set "downloading" and then returned without touching it if pendingUpdate had been cleared — which any concurrent check does, including the one the status bar fires on mount. The spinner stayed forever, and the button that could retry only renders in the "available" state. It now reports what happened and leaves a state the user can act from. The same applies when relaunch fails: the update is on disk, so it says so and says to quit and reopen, rather than implying a re-download. ## Tests Five on the guard, four new on the store. Three fail against the previous version. Two existing tests changed rather than being deleted: the relaunch assertion moved to restartToApply, and the two status-bar tests that asserted the button refuses now assert the refusal itself, since that is where it moved. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Sep 8, 2026
EVWorth
added a commit
that referenced
this pull request
Sep 8, 2026
Closes #353. The chip started a download of unknown size on a single click, and there was no way to put it off — it simply stayed there. Clicking now opens a small confirmation with the version, a link to the release notes, and two choices. Download starts it; Later hides the chip. Later is recorded as the version it applied to, not a flag. A newer release still surfaces: "later" means later for this update, not silence for every update. It is not persisted either — a dismissal should not outlive the run it was made in. Two things the issue asks for are deliberately absent. It wants the size — "Download 100 MB and restart now?". The length is not known until the download starts, when the Started event carries it. An invented estimate would be worse than no number. And it wants the copy to say the app will restart when the download completes. That stopped being true in #573: downloading and restarting are separate, and the restart asks separately. The panel says so instead, and a test asserts the wording does not promise a restart this code no longer performs. Four tests. Two fail against the previous version; the other two describe behaviour that did not exist to fail. Three existing tests now click through the confirmation, since that is the path a user takes. Co-authored-by: Claude Opus 5 <[email protected]>
This was referenced Sep 11, 2026
Closed
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.
Closes #344, #569, #570. Second of the update-system work, after #572.
Three problems on one path, all of them the app deciding something on the user's behalf at a moment nobody chose.
The restart was never asked for
installUpdateended with an unconditionalrelaunch(), so the download finishing closed the app.Downloading and restarting are now separate:
installUpdatestages the update and stops; the status bar offers "Restart to finish update" when the user is ready. That's what VS Code and Slack do, for the reason that applies here — the download is harmless, the restart is the part that can lose work.There was no UI for the
downloadedstate at all, so arelaunch()that failed or hung showed nothing.The refusal lived in the button
The running-query and unsaved-tabs checks were in
StatusBar'sonClick.installUpdatehad none — one caller today, but nothing said the next one had to bring its own. Same shape as the grid's save path before #529.Worse: they ran once, at the click, before a download that can take minutes, and the restart then fired against a state nobody had looked at since. A query started or a tab edited during the download was destroyed by a restart authorised before either existed.
updateBlockersnow lives insrc/lib/update-guard.ts, so both moments can ask without the settings store needing to know about queries or editor tabs. Checked before the download and again before the restart, and it reports every reason rather than the first — so fixing one doesn't walk you into the next.A failed install left the status bar lying
Any concurrent check clears
pendingUpdate— including the one the status bar fires on mount. The spinner stayed indefinitely, and the button that could retry only renders in theavailablestate.It now reports what happened and leaves a state the user can act from. Same when
relaunchfails: the update is already on disk, so it says that and says to quit and reopen, rather than implying a re-download.Tests
Five on the guard, four new on the store. Three fail against the previous version.
Two existing tests changed rather than being deleted, and I want that visible: the
relaunchassertion moved torestartToApply, and the two status-bar tests that asserted the button refuses now assert the refusal — because that's where it moved, not because they were inconvenient.1827 unit + 303 browser green; tsc/dprint/eslint clean.
Left in this area
#571 (rpm-ostree URL hardcodes x86_64), #346 (effect re-triggers checks), #347 (concurrent checks race), #353 (no preview of what's being installed), #354 (
is_rpm_ostreetoo narrow).🤖 Generated with Claude Code