fix(home): deleting a version keeps the save in its folder: taken in or backed up first #176
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!176
Loading…
Reference in a new issue
No description provided.
Delete branch "madebyjordan/LongshotLauncher:fix/delete-keeps-saves"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deleting a version deleted its whole game folder, including a save in its
user\save, with no copy kept. On Windows that folder holds a save when the game was started outside the launcher (Explorer, a taskbar pin, Steam), or when the start-up gather was skipped (the game was running) or failed. Now Delete never loses a save and never leaves the player stuck.What changes
BuildRegistry.DeleteGame, which the Delete dialog calls:DeleteFolder's refusal checks first (not a game folder, a link, the home, a kept folder, a folder holding the shared saves), so a folder it will refuse is never touched;user\savewhole to<backups>\delete-<stamp>\<folder>, checked byte for byte (a retry with nothing changed reuses an identical earlier copy);Linux is never stuck either: its save is backed up, then the folder goes.
DeleteFolderbacks up the same way for the old-folders offer. With no backup place given it still refuses a folder that holds a save.A delete that stops part-way (a file held open, a read-only file) still reports where the backup is (
FolderNotDeleted), in the dialog and in the old-folders offer.Gathers take a cross-process lock (
Saves.GatherAlone): an exclusive lock file,.longshot-gather.lock, in Longshot's user folder. Start-up, Play, the desktop shortcut's--playand Delete all go through it. A gather waits up to 10 s, then is refused with nothing changed.On the screen: the row shows as deleting before the gather starts; a gather or backup notice is kept if the delete then fails; the reason a backup failed is a catalog text in all 12 catalogs plus es-419.
Testing
Windows 11, .NET SDK 10.0.404; TEMP on its long path.
python -I tests/test_launcher_core.py: the check commitc61a25ffails on main:Deleting a version's folder deleted the save in its user\save, with no copy kept.With the fix, 1461 checks passed. Merged with the gather PR, 1484.DeleteGame, skipping the backup, comparing lengths only, removing the refusal checks, gathering without the lock, dropping the backup path on a failed delete.Not tested: the dialog in a real window, and a file the real game holds open (a fault hook stands in).
Known, not changed here:
%APPDATA%\Longshotat every Windows start.LauncherService.Remove(deleteFiles: true)has no caller; it could go.🤖 Generated with Claude Code
Possibly related, for context: