Stop update checks from replacing a downloaded update before Relaunch installs it - #2312
Open
patleeman wants to merge 3 commits into
Open
Stop update checks from replacing a downloaded update before Relaunch installs it#2312patleeman wants to merge 3 commits into
patleeman wants to merge 3 commits into
Conversation
… staging Every update check (Settings page visits, the 15-minute activity check, and the hourly timer) made Squirrel replace its finished update.<id> staging directory with a fresh partial extraction while the UI still offered Relaunch. Clicking Relaunch then handed ShipIt a directory without bb Nightly.app, ShipIt aborted after three retries, and the old build relaunched - so nightly updates never applied. Once electron-updater reports an update downloaded, skip further checks until that install is applied.
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 was wrong
On macOS, every desktop update check made Squirrel.Mac discard its finished
update.<id>staging directory and start a fresh, partial extraction for the next fetch — while the Settings UI kept offering Relaunch. The check paths were: the unthrottled check on every Settings → Updates page visit (BB_DESKTOP_CHECK_FOR_UPDATES_CHANNEL), the 15-minute activity check, and the hourly timer. A Relaunch clicked after any of these re-checks handed ShipIt install instructions pointing at a directory that did not yet containbb Nightly.app. ShipIt retried three times, loggedFailed to copy bundle … No such file or directory, aborted the update, and relaunched the old build. Net effect: nightly updates downloaded forever and never applied.Observed live on an affected machine: the app quit cleanly on Relaunch (owned-runtime children stopped, main process exited), then ShipIt immediately failed three times against the newest staging dir while an older, complete staging had been discarded minutes earlier.
What changed
apps/desktop/src/desktop-auto-update.ts: once electron-updater reports the update downloaded,checkForUpdates()and thereforecheckAfterActive()return the held state instead of hitting the updater, so nothing restages or invalidates the pending ShipIt install until it is applied.apps/desktop/test/desktop-auto-update.test.ts: regression test asserting no further updater checks run while an update is downloaded (including after the activity-check throttle window passes) and the downloaded state is preserved.No wire-format changes; no HOST_DAEMON_PROTOCOL_VERSION bump needed.
How you verified
pnpm exec turbo run test --filter=@bb/desktop --force— all 4 tasks green.pnpm exec turbo run typecheck --filter=@bb/desktop --force— green.Installation error: … Failed to copy bundle … No such file or directory, ×3, abort); with a complete staging left undisturbed and the app quit normally, ShipIt loggedInstallation completed successfullyand the app came up on the new version.