fix(home): games whose row went are listed again once, not at every start #191

Merged
HumanBean merged 1 commit from dyst/LongshotLauncher:fix/relist-once into main 2026-11-17 22:37:08 +00:00
Member

#187 lists again, at every start, the games whose row went (#141). Because it runs every time, it undoes the player's own removals: deleting an rc instance brings back an older rc folder at the next start. It also writes builds.json when that file could not be read, which can leave a newer launcher's list only in builds.json.broken. This makes it a one-time recovery and fixes the rest of the review on #187: #187 (comment)

What changed, by review point

  1. Deleted instances come back and 7. every start → once. Leftovers.ShouldRelist decides: it runs whenever builds.json was not there (a first start, or a lost list, the case #141 is about), and once on a launcher that never ran it, remembered as RelistedLostBuilds in settings.json. That once covers players who lost rows before #153. After that, a build taken off the list stays off.
  2. Never into a list that could not be read. LauncherService.Relist does nothing when Registry.Problem != null (LostUpdate included), and ShouldRelist says no too. Settings that could not be read count as done and aren't written over.
  3. Duplicates by channel, not folder name. Candidates are ranked by the channel they go on (Versions.Channels), then newest first (Versions.Compare). builds/stable and builds/rc at the same version become two instances, stable first. The default the list already has always stays (Add without makeDefault); a re-listed row is the default only when the list has none.
  4. Each row on its own channel. The "already listed" check uses UpdatePolicy.ChannelOf(b.Channel, b.Version) for every row, not the candidate version's track, so a stable row no longer holds back the rc channel's game.
  5. rc (2)-style names. InstanceFolders.ChannelNamed drops " (2)" and on, for old flat folders (builds/rc (2)) and for track folders (builds/nightly (2)/<version>). #184 had already covered builds/rc/<version>, but not a numbered track folder.
  6. Same result whichever runs first. A row whose folder was deleted by hand (BuildRegistry.Gone, what ForgetGone drops at Refresh) holds back nothing. A row on an unplugged drive (its parent folder is gone too) still does.
  7. Performance. Relist now runs once rather than at every start. When it does run, it reads the rows once in memory, instead of every listed folder's stamp for each candidate (NewestOfItsChannel).
  8. One scan. Leftovers.Unlisted is the shared scan for Find, LostUpdate and Relist: folders, links, taken, kept, read errors. The hand-written Rank and comparator are gone. NewestOfItsChannel stays for Find only, unchanged.

Nothing the player sees changes: the toast and its texts are as before, and no new texts.

Tests

  • tests/launcher_core/UnlistedChecks.cs, new checks:
    • ShouldRelist: no builds.json gives yes; a list never relisted gives once; after that a removed build stays off; an unreadable builds.json (format 2, a newer launcher's) gives no.
    • builds/stable and builds/rc at v3.0.0 are both listed, each on its channel, stable the default; Find offers neither.
    • A stable row doesn't hold back the rc channel's game, and the list's default stays.
    • builds/rc (2) holding a stable release stays on rc; builds/nightly (2)/<version> is on nightly.
    • A row whose folder was deleted by hand doesn't hold back the older game.
    • The unplugged-drive check now models a drive that isn't there (its parent folder missing), which is what Gone already tells apart from a folder deleted by hand. Its expectation is unchanged.
    • RelistSourceChecks: LauncherService.Relist returns on an unreadable list, asks ShouldRelist before Leftovers.Relist, and remembers it.
  • python -I tests/test_launcher_core.py: 1976 checks passed. python -I tests/test_release.py: OK. dotnet build App -c Release: 0 warnings, 0 errors. Windows 11.
  • Not run in the real window or on Linux.

Follows up #187; #141.

#187 lists again, at every start, the games whose row went (#141). Because it runs every time, it undoes the player's own removals: deleting an rc instance brings back an older rc folder at the next start. It also writes builds.json when that file could not be read, which can leave a newer launcher's list only in builds.json.broken. This makes it a one-time recovery and fixes the rest of the review on #187: https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/187#issuecomment-45788 ## What changed, by review point 1. **Deleted instances come back** and **7. every start → once.** `Leftovers.ShouldRelist` decides: it runs whenever builds.json was not there (a first start, or a lost list, the case #141 is about), and once on a launcher that never ran it, remembered as `RelistedLostBuilds` in settings.json. That once covers players who lost rows before #153. After that, a build taken off the list stays off. 2. **Never into a list that could not be read.** `LauncherService.Relist` does nothing when `Registry.Problem != null` (LostUpdate included), and `ShouldRelist` says no too. Settings that could not be read count as done and aren't written over. 3. **Duplicates by channel, not folder name.** Candidates are ranked by the channel they go on (`Versions.Channels`), then newest first (`Versions.Compare`). `builds/stable` and `builds/rc` at the same version become two instances, stable first. The default the list already has always stays (`Add` without `makeDefault`); a re-listed row is the default only when the list has none. 4. **Each row on its own channel.** The "already listed" check uses `UpdatePolicy.ChannelOf(b.Channel, b.Version)` for every row, not the candidate version's track, so a stable row no longer holds back the rc channel's game. 5. **`rc (2)`-style names.** `InstanceFolders.ChannelNamed` drops " (2)" and on, for old flat folders (`builds/rc (2)`) and for track folders (`builds/nightly (2)/<version>`). #184 had already covered `builds/rc/<version>`, but not a numbered track folder. 6. **Same result whichever runs first.** A row whose folder was deleted by hand (`BuildRegistry.Gone`, what `ForgetGone` drops at Refresh) holds back nothing. A row on an unplugged drive (its parent folder is gone too) still does. 8. **Performance.** Relist now runs once rather than at every start. When it does run, it reads the rows once in memory, instead of every listed folder's stamp for each candidate (`NewestOfItsChannel`). 9. **One scan.** `Leftovers.Unlisted` is the shared scan for Find, LostUpdate and Relist: folders, links, taken, kept, read errors. The hand-written `Rank` and comparator are gone. `NewestOfItsChannel` stays for Find only, unchanged. Nothing the player sees changes: the toast and its texts are as before, and no new texts. ## Tests - `tests/launcher_core/UnlistedChecks.cs`, new checks: - `ShouldRelist`: no builds.json gives yes; a list never relisted gives once; after that a removed build stays off; an unreadable builds.json (format 2, a newer launcher's) gives no. - `builds/stable` and `builds/rc` at v3.0.0 are both listed, each on its channel, stable the default; Find offers neither. - A stable row doesn't hold back the rc channel's game, and the list's default stays. - `builds/rc (2)` holding a stable release stays on rc; `builds/nightly (2)/<version>` is on nightly. - A row whose folder was deleted by hand doesn't hold back the older game. - The unplugged-drive check now models a drive that isn't there (its parent folder missing), which is what `Gone` already tells apart from a folder deleted by hand. Its expectation is unchanged. - `RelistSourceChecks`: `LauncherService.Relist` returns on an unreadable list, asks `ShouldRelist` before `Leftovers.Relist`, and remembers it. - `python -I tests/test_launcher_core.py`: 1976 checks passed. `python -I tests/test_release.py`: OK. `dotnet build App -c Release`: 0 warnings, 0 errors. Windows 11. - Not run in the real window or on Linux. Follows up #187; #141.
fix(home): games whose row went are listed again once, not at every start, and never into a list that could not be read
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
79166cd534
Relist (#141) ran at every start, so it undid the player's own removals:
a deleted rc.5 brought back an older rc.3 folder, start after start. It
also wrote builds.json when that file could not be read (a newer
launcher's list), leaving that list only in builds.json.broken.

- Leftovers.ShouldRelist: once per install (RelistedLostBuilds in the
  settings), and whenever builds.json was not there (a first start, a
  lost list). Never when builds.json could not be read; settings that
  could not be read count as done, and are not written over.
- Each row counts on its own channel (UpdatePolicy.ChannelOf), not its
  version's track: a stable row no longer holds back the rc channel's
  game. Candidates are ranked by the channel they go on
  (Versions.Channels, Versions.Compare), not by folder name, so builds/rc
  and builds/stable at one version are two instances.
- The channel a folder's name says ignores " (2)" and on
  (InstanceFolders.ChannelNamed): builds/rc (2), builds/nightly (2)/<v>.
- A row whose folder was deleted by hand (BuildRegistry.Gone) holds back
  nothing, whether Relist or ForgetGone runs first.
- One scan (Leftovers.Unlisted) for Find, LostUpdate and Relist; Relist
  reads the rows once instead of every listed folder's stamp per
  candidate.

Follows up #187 (review: #187 (comment)), #141

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/relist-once 2026-11-17 22:37:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!191
No description provided.