Skip to content

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

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

fix: preserve staged update dir when pruning orphaned updates on macOS#50215
VerteDinde merged 2 commits into39-x-yfrom
trop/39-x-y-bp-fix-preserve-staged-update-dir-when-pruning-orphaned-updates-on-macos-1773268955588

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 39-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 bd3abf3 into 39-x-y Mar 12, 2026
57 checks passed
@VerteDinde VerteDinde deleted the trop/39-x-y-bp-fix-preserve-staged-update-dir-when-pruning-orphaned-updates-on-macos-1773268955588 branch March 12, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

39-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