fix(storage): an unfinished install can be removed #417

Merged
HumanBean merged 2 commits from HumanBean/LongshotLauncher:fix/remove-unfinished-install into main 2026-12-04 17:36:32 +00:00
Owner

A user ended up with the same nightly listed twice under Settings › Storage › Installed versions, with no way to remove one of them. The second one is an install that never finished (about 1.9 GiB for them).

How it happens

Each install gets a new folder, and a folder only counts as a version once version.json is written after a successful build. A failed or interrupted install keeps its folder, and starting over makes another. Storage names both after their release but offered Remove only on the finished one. Worked out from the code; I don't have the user's logs.

Changes

  • Storage marks such a row Not installed, and offers Remove if the launcher made the folder. Copies found in a chosen library that the launcher didn't make still have no Remove.
  • Removal accepts the .launcher-installing marker. Without this, an unfinished install in a chosen (not the default) library was refused as containing an additional entry. The usual removal checks still apply.
  • Removing the folder of a stopped build clears that build, so it isn't retried against a missing folder.
  • A builder download that was fetched ahead of a build is marked the same way and can now be removed too.
  • A separate commit applies rustfmt to src/update.rs, which fails the format check on main.

Not changed here: new installs still don't reuse or clean up an earlier unfinished folder.

A screenshot is in the first comment.

Testing

  • tests/test_launcher_core.py (format, Clippy, 409 tests) and Tooling's test_release.py pass on Linux. They ran with LONGSHOT_TEST_PLAYER_PROCESSES=LongshotLauncher, because an unrelated longshot-builder running on the PC fails two tests otherwise.
  • The new test fails without the marker fix.
  • In the Linux launcher with fake version folders, Remove deleted the unfinished folder and kept the finished one.
  • Not tried on Windows. The stopped-build reset has no test.

🤖 Generated with Claude Code

A user ended up with the same nightly listed twice under Settings › Storage › Installed versions, with no way to remove one of them. The second one is an install that never finished (about 1.9 GiB for them). ## How it happens Each install gets a new folder, and a folder only counts as a version once `version.json` is written after a successful build. A failed or interrupted install keeps its folder, and starting over makes another. Storage names both after their release but offered Remove only on the finished one. Worked out from the code; I don't have the user's logs. ## Changes - Storage marks such a row **Not installed**, and offers **Remove** if the launcher made the folder. Copies found in a chosen library that the launcher didn't make still have no Remove. - Removal accepts the `.launcher-installing` marker. Without this, an unfinished install in a chosen (not the default) library was refused as containing an additional entry. The usual removal checks still apply. - Removing the folder of a stopped build clears that build, so it isn't retried against a missing folder. - A builder download that was fetched ahead of a build is marked the same way and can now be removed too. - A separate commit applies rustfmt to `src/update.rs`, which fails the format check on `main`. Not changed here: new installs still don't reuse or clean up an earlier unfinished folder. A screenshot is in the first comment. ## Testing - `tests/test_launcher_core.py` (format, Clippy, 409 tests) and Tooling's `test_release.py` pass on Linux. They ran with `LONGSHOT_TEST_PLAYER_PROCESSES=LongshotLauncher`, because an unrelated `longshot-builder` running on the PC fails two tests otherwise. - The new test fails without the marker fix. - In the Linux launcher with fake version folders, Remove deleted the unfinished folder and kept the finished one. - Not tried on Windows. The stopped-build reset has no test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
fix(storage): an unfinished install can be removed
Some checks failed
CI / What the change needs (pull_request) Successful in 4s
CI / Lint (actionlint, ShellCheck, gitleaks) (pull_request) Successful in 10s
PR title / Conventional Commit title (pull_request) Successful in 5s
CI / Rust formatting, lint and tests (pull_request) Failing after 15m11s
CI / Release packages and stable upgrades (pull_request) Successful in 37m25s
22a978fb8e
A failed or interrupted install keeps its folder, listed under the same name as
a finished one and without Remove. Storage now marks it Not installed and offers
Remove for folders the launcher made. Removal also accepts the install marker,
which it refused in a chosen library.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Author
Owner

Storage with an unfinished install, in a test launcher with fake versions

![Storage with an unfinished install, in a test launcher with fake versions](https://git.magicbean.dev/attachments/9ced8eb8-138b-4b2f-be75-e010c71eac43)
Member

Possibly related, for context:

  • PR #317 feat(versions): show previous launcher builds and remove one in one action — Open removal work also modifies version/storage removal paths.
  • issue #386 Install: Removing nightly-830 returns to the confirmation dialog — Related removal failure report; its protected-profile issue was separately fixed in #387.
  • issue #336 Idea: Automatically clean up superseded nightly builds and builder cache — Related storage cleanup request, focused on superseded builds and cache.
Possibly related, for context: - PR #317 feat(versions): show previous launcher builds and remove one in one action — Open removal work also modifies version/storage removal paths. - issue #386 Install: Removing nightly-830 returns to the confirmation dialog — Related removal failure report; its protected-profile issue was separately fixed in #387. - issue #336 Idea: Automatically clean up superseded nightly builds and builder cache — Related storage cleanup request, focused on superseded builds and cache.
HumanBean deleted branch fix/remove-unfinished-install 2026-12-04 17:36:32 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!417
No description provided.