Skip to content

fix(desktop): keep windows if update install fails - #8429

Open
Adolanium wants to merge 2 commits into
pingdotgg:mainfrom
Adolanium:fix/desktop-install-keep-windows
Open

fix(desktop): keep windows if update install fails#8429
Adolanium wants to merge 2 commits into
pingdotgg:mainfrom
Adolanium:fix/desktop-install-keep-windows

Conversation

@Adolanium

@Adolanium Adolanium commented Aug 27, 2026

Copy link
Copy Markdown

What Changed

Desktop update install no longer destroys every window before quitAndInstall.

Backends still stop first, so WSL children get SIGTERM. quitAndInstall runs 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 quitAndInstall left no window and no path to open one. Tests covered backend-stop failure before destroy. They did not cover this path.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (N/A)
  • I included a video for animation/interaction changes (N/A)

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 destroyAll before quitAndInstall. 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 quitAndInstall or 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 via installSteps and assert success order quitAndInstalldestroyAll, and failure order quitAndInstallstartBackend with 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 quitAndInstall fails during update install

  • Reorders the install flow in make so electronWindow.destroyAll runs only after quitAndInstall starts, not before
  • On ElectronUpdaterQuitAndInstallError or unexpected error, stopped backends are restarted via a captured restartStoppedBackends effect instead of leaving the app in a stopped state
  • Adds tests in DesktopUpdates.test.ts asserting install step ordering and that windows are kept on failure
  • Risk: backend instances are now captured before stopping and restarted concurrently on failure; if a backend cannot restart, the app may be left without a running backend despite windows remaining open

Macroscope summarized 4b33ef8.

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

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a1d9051-eb13-497f-a04d-034f27f9c8fa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 27, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/desktop/src/updates/DesktopUpdates.ts
@macroscopeapp

macroscopeapp Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 4b33ef8

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.
@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant