Skip to content

fix: preserve staged update dir when pruning orphaned updates on macOS#50216

Merged
VerteDinde merged 2 commits into40-x-yfrom
trop/40-x-y-bp-fix-preserve-staged-update-dir-when-pruning-orphaned-updates-on-macos-1773268956314
Mar 12, 2026
Merged

fix: preserve staged update dir when pruning orphaned updates on macOS#50216
VerteDinde merged 2 commits into40-x-yfrom
trop/40-x-y-bp-fix-preserve-staged-update-dir-when-pruning-orphaned-updates-on-macos-1773268956314

Conversation

@trop
Copy link
Copy Markdown
Contributor

@trop trop bot commented Mar 11, 2026

Backport of #50210

See that PR for details.

Notes: Fixed an issue on macOS where calling autoUpdater.quitAndInstall() could fail if checkForUpdates() was called again after an update was already downloaded.

…macOS

The previous squirrel.mac patch cleaned up all staged update directories
before starting a new download. This kept disk usage bounded but broke
quitAndInstall() if called while a subsequent checkForUpdates() was in
flight — the already-staged bundle would be deleted out from under it.

This reworks the patch to read ShipItState.plist and preserve the
directory it references, deleting only truly orphaned update.XXXXXXX
directories. Disk footprint stays bounded (at most 2 dirs: staged +
in-progress) and quitAndInstall() remains safe mid-check.

Also adds test coverage for the quitAndInstall/checkForUpdates race and
a triple-stack scenario where 3 updates arrive without a restart.

Refs #50200

Co-authored-by: Samuel Attard <sattard@anthropic.com>
@trop trop bot requested a review from a team as a code owner March 11, 2026 22:42
@trop trop bot requested review from a team and MarshallOfSound March 11, 2026 22:42
@trop trop bot added 40-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Mar 11, 2026
@VerteDinde VerteDinde enabled auto-merge (squash) March 11, 2026 23:34
@VerteDinde VerteDinde merged commit 9be5389 into 40-x-y Mar 12, 2026
56 of 57 checks passed
@VerteDinde VerteDinde deleted the trop/40-x-y-bp-fix-preserve-staged-update-dir-when-pruning-orphaned-updates-on-macos-1773268956314 branch March 12, 2026 01:57
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 12, 2026

Release Notes Persisted

Fixed an issue on macOS where calling autoUpdater.quitAndInstall() could fail if checkForUpdates() was called again after an update was already downloaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

40-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant