fix(launcher): protect saves and recover interrupted builds and folder moves #293
No reviewers
Labels
No labels
area/build
area/install
area/mods
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!293
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:refactor/launcher-followup"
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?
The Rust launcher repeated the same confirmation setup across eight mod actions and kept diagnostic report state in the main game model. This follow-up to #284 gives both a single place to change.
The changes preserve the existing mod approval prompts and report preview requirement. Formatting, all 15 translation catalogs, and the pinned Longshot compatibility checks passed locally. Rust lint, tests and release packaging are tracked by CI.
Save safety and recovery
Profile duplication now locks and recovers the source save before copying it. Slot transfers preserve a free slot number and stop when all six game slots are occupied. Destructive profile cleanup includes the actual backup directory and explains that it takes no final backup. Folder moves record the verified destination before publishing registry and preference changes so first start can finish an interrupted metadata update without deleting the original. Leftover move staging folders and parked originals appear as individual Storage rows for recovery.
Build and desktop behavior
A crashed Unix builder can leave compiler or shader workers holding its output pipes. The launcher detects the exit, stops remaining workers in its process group and drains the output. Library fetches respond to cancellation while waiting for the storage lock. The keep-awake inhibitor covers source builds, reuse and rebuilds, and its shutdown has a deadline. Game output now uses the launcher log directory. Update discovery can show other tracks when the main-branch lookup fails.
Translations and release notes
The UI catalog check now rejects missing source keys, including marked Rust model labels, and honors regional fallback. The new language entries are machine-assisted drafts awaiting native-speaker review.
On upgrade from 1.3.x, stable saves and loose mods are copied. Launcher preferences start fresh, including the language, update track, active profile and custom cache location. Set a custom cache drive before the first build. Save progress is read-only. The binary save editor and its contract fixtures were retired. The Hookshot game-settings import was retired. Individual Hookshot slots can be imported, and complete save ZIPs can include account and option files. The README and save guide document these changes.
Packaging downloads checksum-pinned toolchains and AppImage utilities. The update-handoff integration test downloads the previous launcher source and uses isolated Linux and Wine fixtures. The public trust-key files are compared in CI.
Verification
The Linux Rust suite passed 164 tests. The network-dependent signed downgrade test was run separately against published stable and also passed. The Windows release target passed the all-targets cross-check. Formatting, Clippy, pinned builder contracts and all 15 catalog checks passed. The pinned Tooling release suite passed 46 tests. Physical Windows, Steam Deck and controller runs remain pending.
The published Linux 1.3.1 AppImage was verified against its release digest and started in an isolated home. After stable closed, the PR executable opened that home without an install prompt, copied the test save and preserved the original save and preferences. This exercises first start after the executable swap. The signed updater and rollback have separate package tests.
ef1ae3abd3b93692b0deWIP: refactor(launcher): simplify mod confirmations and build report handlingto WIP: fix(launcher): protect saves and recover interrupted builds and folder moves@review
Recommendation: Request changes. An interruption during folder publication can leave shortcuts or the shared mod store pointing at the destination while the launcher continues to use the original folders. The pull request also combines several independent topics despite the repository’s one-topic rule.
The change consolidates launcher UI code and adds save and folder recovery, builder shutdown handling, translations, and upgrade documentation. The recovery work preserves original data, but its publication sequence still has an unrecoverable interruption window.
Blocking (1): must change before merging.
src/folders.rs:635: Persist recovery information before publishing shortcuts and mod-store links. (more on the line) Do: Journal the intended move and its publication state before the first externally visible change, and make startup complete or roll back each recorded step idempotently.Should fix (2): not blocking, but worth doing before merging.
src/game/process.rs:497: Returning after the deadline leaves the detached output-reader threads blocked when an escaped descendant keeps a pipe open indefinitely. (more on the line) Do: Use cancellable or nonblocking pipe readers and close or join them before returning from the timeout path.@fixcan do L1, L2 and L3.Checks: Still running:
CI / Rust formatting, lint and tests (pull_request),CI / Release packages and stable upgrades (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven for interrupted folder moves: the reported Linux suite passed 164 tests, but the receipt is written after some externally visible changes, so it does not cover every interruption point. This is not a performance change.
Other systems: Folder moves affect Steam shortcuts, the shared mod store, installed-version registry, and profiles on Windows and Linux. The reported physical Windows and Steam Deck runs remain pending. Unix builder recovery also affects subprocesses and output-reader threads.
Switches: The CI environment variable is now required to be true by the two CI installation scripts; it defaults to unset and prevents accidental local package installation. No player-facing switch was added.
Reviewed:
60045b8321against5932797e8e: Read the repository rules, commit log, folder transaction and save-lock implementations, process runner, cleanup implementation, and the principal changed diffs. Skimmed the remaining diffs and did not read every changed code file in full or inspect every translation catalog; this review is therefore incomplete.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run, as requested. The author reports the Linux Rust suite, cross-checks, catalog checks, and an isolated published-launcher upgrade run; physical Windows, Steam Deck, and controller runs remain pending.
Overlaps and merge order: Not checked; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -556,41 +635,75 @@ impl Change {attempted += 1;L1 (blocking): Persist recovery information before publishing shortcuts and mod-store links. Those changes currently happen before the receipt exists.
When: If the launcher exits after a data move repoints a cache’s mod-store link but before the receipt is written, startup finds no pending move and retains the old data-folder setting. The builder then uses a mod store at the new location while profiles and launcher settings still refer to the old location; a retry can also be blocked by the already-published destination.
Do: Journal the intended move and its publication state before the first externally visible change, and make startup complete or roll back each recorded step idempotently.
@ -421,0 +494,4 @@tree_stopped = true;} else if tree_stopped && elapsed >= Duration::from_secs(3) {// An escaped descendant may keep a descriptor open indefinitely.return Ok(Answer {L2 (should fix): Returning after the deadline leaves the detached output-reader threads blocked when an escaped descendant keeps a pipe open indefinitely.
When: A builder starts a descendant in another process group that inherits stdout or stderr and stays alive. The runner returns after three seconds, but the corresponding thread remains blocked in read_lines for the lifetime of that descendant; repeated operations can accumulate threads and file descriptors.
Do: Use cancellable or nonblocking pipe readers and close or join them before returning from the timeout path.
WIP: fix(launcher): protect saves and recover interrupted builds and folder movesto fix(launcher): protect saves and recover interrupted builds and folder movesAddressed both code findings in
aa93e844b09e.Local checks passed for 11 folder tests, the live-writer regression and all 46 Tooling tests. The full local Rust check was interrupted. Forge is running the Rust and release-package checks on the pushed commit.