Repository navigation
Conversation
Restoring a snapshot, restoring a single file, and keeping the other device's version of a conflicted save each take a safety snapshot of the save they are about to replace, and each carried on when that copy could not be made. A full disk, a locked file or a database error then emptied or overwrote the save with nothing to go back to. Switching branches already refused in that case; these now do the same. Restore also took its safety copy only when the main save folder held something, then emptied every save location. A settings or mods folder holding the only work was cleared without a copy. The check now covers every location, shared with branch switching. Two ways a short file could stand in for a save are closed as well: - A file whose read failed part-way into an archive was reported as skipped, but the zip entry already started stayed in it, cut short. A restore put that short file back. The archive is now abandoned instead. - Restoring one file truncated it in place before copying, so a copy that failed part-way left it cut short. It is now written beside the file and renamed over it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… replace The single-file restore now writes to the file's name plus delta.TmpSuffix, which manifests and snapshots already leave out, and replaces the file through delta.ReplaceFile. That retries while antivirus holds the file, clears a read-only flag, and marks the change as OpenSave's own for the watcher. Before, a temporary name of its own in the save folder could have been picked up by a snapshot or sync, and a single failed rename on Windows failed the restore. Tests: a damaged entry leaves the live file untouched with no temporary file behind (on the previous code it overwrote the save, then reported the error), and a restore over a deleted main save folder still works. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@GeneBO98 is attempting to deploy a commit to the sivadaboi's projects Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
Reviewed and tested, looks good. One small thing: in |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Thanks, done in d8f7e97: the comment is back above |
This branch has not been deployed
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.
Restoring a snapshot, restoring a single file, and "keep the other device's version" each take a safety snapshot before replacing the save. Each one carried on when that copy failed. A full disk, a locked file or a database error then emptied or overwrote the save with nothing to go back to. Branch switching already refuses in that case; this does the same for the other three.
Changes
snapshot.Restore): if the safety copy, or the temporary copy of the archive kept safe from pruning, can't be made, the restore stops with "nothing was changed".anySaveContent, shared withSwitchBranch.conflict.go): stops instead of overwriting when the copy of this device's version fails. The conflict stays open.handleRestoreFile/extractSingleFile):<file>+delta.TmpSuffixand replaces the file through the newdelta.ReplaceFile, the same retrying, owntouch-marked replace a sync useserrEntryCutShort).Tests (each fails on
dev-publicwithout the change):TestRestore_StopsWhenTheSafetyCopyFailsTestRestore_SafetyCopyCoversOtherLocationsTestCreate_RefusesAFileCutShortTestConflict_KeepRemoteStopsWhenTheSafetyCopyFailsTestExtractSingleFile_FailingPartWayLeavesTheFile(ondev-publicthe damaged entry overwrites the save, then the call reports an error)Also:
TestRestore_MainFolderDeleted.Draft #31 also touches incomplete snapshots, in a different way; this PR doesn't depend on it.
🤖 Generated with Claude Code