Repository navigation
feat(desktop): install downloaded updates on quit - #358
Merged
Merged
Conversation
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.
Note
Desktop updates download quietly and install on normal quit. Native macOS and Windows testing verified channel-switch safety, installation, and restart. macOS testing also verified failure fallback and exposed a shutdown race fixed in this PR.
What Changed
Downloaded desktop updates now install automatically on normal quit, ready for the next launch. The sidebar stays quiet during checks and downloads, and shows its restart icon only when an update is ready to install. Settings retains manual checks, download progress, and retries; choosing restart still asks for confirmation.
Why
Background downloads previously required an explicit update-and-restart action, even when the user quit normally. Remove the sidebar’s check/download controls and animation state. Ordinary shutdown closes the window and waits for backend cleanup, then styal installs only a ready download matching the selected update track. The updater’s unconditional install-on-quit flag stays disabled: changing tracks clears installation eligibility, and macOS native staging is deferred until this final decision. Native staging errors or a 30-second handoff timeout fall back to ordinary quit; the native relaunch policy is set explicitly for quit versus restart. A one-shot final-window listener survives cleanup so Electron’s default quit cannot bypass update staging. On macOS, closing the last window leaves the app running; installation requires quitting.
Validation
Browser Validation
Exercised the real client against isolated server state with a synthetic project and simulated Electron update bridge. The final pass verified that idle, checking, downloading, and download failures show no sidebar update button; a downloaded update shows the restart icon; cancel sends no install request; confirm sends exactly one; installation failure keeps the retry icon. Settings still displays downloading status and invokes download retry and manual checks. Navigating into and out of Settings worked, with no page errors in the final pass. The native installer was simulated, not invoked. Console inspection found unrelated Clerk production-key origin errors on localhost; styal Link sign-in was not part of this pass.
UI Evidence
Before and after the change, with a download in progress:
Once downloaded, the restart icon and release notes remain available:
Checking → downloading → ready, before:
install-on-quit-before.mp4
Checking → downloading → ready, after:
install-on-quit-after.mp4
Native macOS Validation
Exercised real Electron 41.5.0 and Squirrel.Mac on Apple Silicon/macOS 27 using Developer ID signed test bundles, an isolated bundle ID, separate app data and updater caches, and a local update feed. Test versions were
9.0.0,9.0.1-nightly.20260917.1, and9.0.1; installation was not stubbed.Native Windows Validation
Exercised real Electron and NSIS installers on Windows 11 x64 using an isolated app identity, installation directory, app data, updater cache, and local update feed. Test versions were
9.0.0,9.0.1-nightly.20260917.1, and9.0.1; installation was not stubbed.9.0.0installed and the app closed.9.0.0installed and the app closed.9.0.1, with no automatic relaunch.9.0.0with9.0.1and automatically opens the updated app window. Closing that window exits normally.Windows fixtures were unsigned and used a copied resource-monitor binary. Test-only build preparation normalized Windows archive paths and moved payload validation outside the checkout; fixture identity/feed settings were isolated from the real installation. These runs do not verify Authenticode, WSL backend behavior, production installer migration hooks, or release packaging performance. Immediate reopening during native installation and macOS notarization remain unverified.
Written by an agent (Codex, GPT-6).