feat(desktop): download updates in the background - #663
Draft
tonyfettes wants to merge 1 commit into
Draft
Conversation
An installable release found by a check now downloads itself; the staged bundle waits in UpdateReady until the user clicks restart (confirming first while a conversation runs). The startup check waits for the first authoritative host-settings load instead of riding BridgeReady with the default channel, re-fires whenever the update channel moves, and binds replies and downloads to the channel they asked. The host pump stamps its download notifications with the channel they serve so the page can void events from a channel the user has since left; a channel move during a download leaves the flow draining until its terminal event, and manual checks are held until the authoritative settings land. Co-Authored-By: Claude Fable 5 <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.
What
The desktop self-update flow now downloads installable releases by itself; restarting into the staged bundle stays the user's click.
update.downloadimmediately (startup and manual checks alike); the newUpdateReadystate parks the staged bundle behind a "Restart to update" button. The busy-confirmation modal moved from before-download to before-apply, where the interruption actually happens.apply_updatestill runs only on the restart click (swapping the bundle under a running CEF app risks AMFI kills on lazy loads).Channel-race hardening
The update channel derives from the API provider, which loads asynchronously from host settings; the races between that load, channel switches, and the host's single-download pump are closed:
initial_model's default production channel, and re-fires whenever the channel moves (provider switch, remote settings edit, failed-save restore).update.checkreplies carry the channel they asked; a reply landing after the provider moved is void, and the auto-download binds to the checked channel.channelonupdate.download_progress/update.downloaded/update.download_failed; the frontend'sDownloadingUpdatecarries its channel and voids mismatched events, so a leftover staging download can never complete as a production one.host_settings_loaded()— before that the channel is only the default, and an early check could start a wrong-channel download whose reconciliation would swallow the real startup check.Tests
moon test --target js desktop/frontend: 313 passed (new coverage: draining lifecycle, cross-channel event voiding, checks gated on settings, staged version taken from the host, channel-bound replies)moon test --target native desktop/internal/host: 19 passed🤖 Generated with Claude Code