fix(home): a game whose row went is listed again, and a portable launcher's builds folder is looked in (#141) #187
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!187
Loading…
Reference in a new issue
No description provided.
Delete branch "madebyjordan/LongshotLauncher:fix/relist-unlisted-141"
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?
A portable launcher could lose every row of its list while its games were still in its own builds folder, and then asked for a first build: a dump and an hour (#141). Nothing ever listed those games again, and for a portable launcher the old-versions offer and #125's lost-update fix never looked in its builds folder at all.
Fixes #141
Why the reporter's builds vanished
Before #153 (rows follow a renamed portable folder), renaming the folder above a portable launcher made every row's path wrong, and
ForgetGonedropped them all as "deleted outside the launcher". The games stayed inLongshotLauncher-data\builds(rc,v3.0.0-rc5). #153 stops new losses; this lists the lost ones again, and any game whose row went some other way (a lostbuilds.json).A second bug kept every existing rescue away from a portable launcher:
Leftovers.FindandLeftovers.LostUpdateleft out any folder inside the launcher's home, and a portable launcher's builds folder is inside its home. So its old versions were never offered for deletion, and a lost update was never given back.What changes
Leftovers.Relist, at the home's start, after the lost updates and before the old-versions offer. A game folder directly in the builds folder is listed again when:Findalready uses to never offer it for deletion), and no row of its channel has a version as new, its game there or not (a row on an unplugged drive never brings an older game back beside it).Of two on one channel, only the newer; the older stays an old version and is offered for deletion as before. Stable first, then release candidates, then nightlies, so the default of an empty list is a release. It goes on the channel its folder is named after (
rc,stable,nightly) when its version is on that channel, else on its version's.The home check goes one way:
Find,LostUpdateandRelistleave out a folder that holds the launcher's home, no longer one that is in it. Deleting already worked that way (MayDelete).LauncherService.Relistruns the lost updates, then the games listed again: one save, one tools prune after both.On the home: the existing toast "{0} was found in its own folder and is listed again." (already translated); several found at once share one toast, a new text in all 12 catalogs. The launcher's log names each.
No screen changes beyond the toast.
Testing
Windows 11, .NET SDK 10.0.404, TEMP on its long path.
python -I tests/test_launcher_core.py: the check commit fails on main withEach channel's newest game whose row went is listed again, from a portable launcher's own builds folder too, and nothing else (got: ).With the fix, 1737 checks passed. The check commit addsRelistwith main's behaviour (it lists nothing) and givesLostUpdatethe home apart as main used it, so the failure is the bug's, not a missing function.UnlistedChecks: the reporter's layout (builds folder inside the portable home), the default, listed once only, the older one then offered, a no-version and a no-game folder, a folder holding the home, a kept folder, the folder-name channel both ways, a listed newer build, a row whose game is missing, and a portable launcher's lost update.python -I tests/test_release.pyhas 9 errors on this PC on this branch and without it (signing tools); this PR doesn't touch release code.Not tested: a real portable launcher on the reporter's folder layout in a window, and Linux (the checks use the Linux game layout, but ran on Windows).
Known, not changed here:
Nup/Romfs/Exefs), so its next update asks for the dump.make_game.pyin the builds folder is listed at every start. The only way to drop that row is Delete, which deletes the folder.LONGSHOT_LAUNCHER_HOME) each list the other's builds.🤖 Generated with Claude Code
Review after merge, from reading the diff (
4cf5013against0e96947). Nothing here was run, so treat each point as something to confirm. File and line refer to that head.Most serious
Core/Leftovers.cs:134).Relistruns at every start and can't tell a row lost by accident from one the player deleted. Example: the player deletes their rc row at v3.0.0-rc.5 because they want no rc build. An older unlisted folderv3.0.0-rc.3is still there (it holds a save or mods, soFindnever offered it, or the player never answered). At the next startRelistsees it as the rc channel's newest unlisted game and shows "v3.0.0-rc.3 was found in its own folder and is listed again." The delete is undone, and this repeats for every older folder.App/LauncherService.cs:385).Relistadds rows and callsRegistry.Save()even whenRegistry.Problem != null. Example: the player switches to an older launcher andbuilds.jsonhas Format 2, soLoadreturns an empty list withProblemset.Relistadds the channel-newest folders and saves a Format 1 list over the newer launcher's. Back on the newer launcher, its list survives only inbuilds.json.broken, which it never reads. Before this PR nothing wrote the file until the player acted.Wrong channel or wrong folder
Core/Leftovers.cs:129). Duplicates are ranked by the version's track, and ties go toCompareOrdinalon the folder name, not to the channel the row goes on. Withbuilds/rcandbuilds/stableboth at v3.0.0 and both rows gone,rcsorts first, is listed on the rc channel and becomes the default. For stable,NewestOfItsChannelsees the listed rc folder at v3.0.0 and skips it, andFindthen offers the player's stable folder for deletion.Core/Leftovers.cs:137). The check usesOnChannel(rv, TrackOf(version))and ignores each row's ownb.Channel. A stable row (or a stable folder just re-listed) at v3.0.0 stops a lostrcfolder at v3.0.0-rc.5 from being re-listed, andFindthen offers that rc build for deletion as an old version, though it was the only build on that channel.Core/Leftovers.cs:139). Onlyrc,stableandnightlycount, butLauncherSettings.FolderFornames a channel's second buildrc (2),nightly (2). Example: a second rc build inrc (2)that was updated to stable v3.0.0 (rc follows stable) is re-listed on the stable channel and stops getting release candidates, whilercat the same version gets the rc channel.App/ViewModels/HomeViewModel.cs:712).Service.Relist()runs beforeRefresh()callsForgetGone. If the player deletesbuilds/rc(rc.6) by hand whilev3.0.0-rc.5is still there: on start 1, the stale rc.6 row blocks re-listing andRefreshthen drops it ("deleted outside the launcher"). On start 2, rc.5 reappears.Design and performance
Core/Leftovers.cs:105). The rows #141 lost were lost once (from before #153, or a lostbuilds.json). Scanning at every start is what reverts every later deliberate removal (points 1, 4 and 6). RunningRelistonly when the list is new or empty (!Registry.Existed), or once as a migration behind a settings flag, would fix #141 without second-guessing the player.Core/Leftovers.cs:134). For each candidate,NewestOfItsChannelchecksIsBuiltand reads the stamp of every listed folder again. The builds folder is now scanned three times at start (LostUpdateper row,Relist,Find), all on the UI thread inOpen(). With a row on a disconnected share or a slow USB drive, eachFile.Existscan block for seconds. Reading the listed versions once per channel and sharing one directory scan would avoid it.Core/Leftovers.cs:117,:127). The scan loop (enumerate, link check,IsBuilt,Taken,IOException) is a third near-copy ofFind's andLostUpdate's; one helper returning the unlisted (folder, version) pairs would keep the three consistent.RankrepeatsVersions.Channels' order (Versions.Channels.IndexOf(TrackOf(v))), and the sort comparator repeatsVersions.Compare.Related
#184 (the builds// layout) adapts
Relistto the nested folders, as you asked on #184. That keeps this behaviour as it is, including point 1, so the fixes above are better as their own follow-up than folded into #184.