fix(desktop): keep windows if update install fails - #8429
Conversation
Install stopped backends, destroyed every window, then called quitAndInstall. If that last step failed, quitting was cleared and an error was stored, but the windows were already gone. There was no path to open one again. Call quitAndInstall first. Destroy windows only after that starts.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7f40bda. Configure here.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, focused desktop update failure-recovery fix. It preserves the existing shutdown flow on successful installs, keeps windows available when installation fails, restarts stopped backends, and includes regression coverage for both behaviors. You can add or adjust custom eligibility rules. Learn more. |
Install still stops backends before quitAndInstall. If that last step fails, the window stayed up but the pool was already down, so the UI was disconnected. On install failure, start the stopped backends again.

What Changed
Desktop update install no longer destroys every window before
quitAndInstall.Backends still stop first, so WSL children get SIGTERM.
quitAndInstallruns next. Windows close only after that starts. If install fails, the error path still clears quitting and records the failure, and the user still has a window.Why
A failed
quitAndInstallleft no window and no path to open one. Tests covered backend-stop failure before destroy. They did not cover this path.Checklist
Note
Medium Risk
Changes shutdown ordering and failure recovery for a user-facing update path; incorrect ordering could still strand backends or leave windows open in edge cases.
Overview
Desktop update install no longer calls
destroyAllbeforequitAndInstall. Backends still stop first (unchanged), then the updater starts install; windows close only after that step begins so a failed install leaves the UI usable.When
quitAndInstallor an unexpected install error occurs after backends were stopped, the flow now restarts pool instances (along with existing reset of quitting/install state and install error reporting). Tests record install ordering viainstallStepsand assert success orderquitAndInstall→destroyAll, and failure orderquitAndInstall→startBackendwith quitting cleared and no window teardown.Reviewed by Cursor Bugbot for commit 4b33ef8. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Keep desktop windows if
quitAndInstallfails during update installmakesoelectronWindow.destroyAllruns only afterquitAndInstallstarts, not beforeElectronUpdaterQuitAndInstallErroror unexpected error, stopped backends are restarted via a capturedrestartStoppedBackendseffect instead of leaving the app in a stopped stateMacroscope summarized 4b33ef8.