Conversation
…pp on copy failure - Stage Synapse.app beside destination, then replaceItemAt for in-place swap - Prevents data loss when copy/move fails after deleting the existing app - Add SynapseAppInstaller tests for fresh install, replace, and failed source Co-authored-by: Danny Peck <dannypeck@gmail.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.
Summary
Fixes a data-loss / app-removal bug in the new GitHub DMG auto-updater: the installer deleted
/Applications/Synapse.appbefore copying the new bundle. IfcopyItemfailed (disk full, permission, interrupted I/O), the user could be left without a working Synapse install.Changes
SynapseAppInstaller: Copy the mounted.appto a hidden staging name next to the destination (same volume), then useFileManager.replaceItemAt(_:withItemAt:...)to swap in place when an existing app is present; otherwisemoveItemto the final path. Staging is removed on failure viadefer.AutoUpdater.copyApp: Delegates toSynapseAppInstaller.installBundle.AutoUpdaterTestscovers fresh install, replace-in-place, and “missing source leaves destination intact”.Validation
SynapseAppInstaller(temp dirs; no/Applicationsaccess required).xcodebuild teston macOS (per repo workflow) should run these tests.Branch:
cursor/recent-commits-critical-bugs-9cda