From 7e97d6a83a40a679bb0278776ecfc74e61bd820d Mon Sep 17 00:00:00 2001 From: ddidderr Date: Thu, 21 May 2026 00:07:24 +0200 Subject: [PATCH] docs(findings): note crash-during-download leaves orphan archives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While reviewing the cancel-cleanup fix (`fix(peer): delete partial files when a download is cancelled`), it became clear that the new `discard_cancelled_download` sweep only runs from inside the in-flight orchestrator. If the process dies mid-download (kill, crash, power loss) the partial `.eti` archives are left behind: `install::recover_on_startup` calls `recover_download_transients`, which only removes `.version.ini.tmp` and `.version.ini.discarded`. The user is left with a card that looks "downloaded" but with corrupted archives that can only be cleared via the explicit `Remove files` action. Closing the gap would mean running the same discard pass during recovery for any game root whose install intent is `None` and whose `version.ini` is absent (intent log already distinguishes installed-and-then-broken from interrupted-download). Not blocking — the user-initiated cancel button is now correct in its scope; this is the symmetric crash recovery case captured for a future cleanup pass. Refs: c380046 (fix(peer): delete partial files when a download is cancelled) --- FINDINGS.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/FINDINGS.md b/FINDINGS.md index 6a22365..3d094fc 100644 --- a/FINDINGS.md +++ b/FINDINGS.md @@ -2,6 +2,20 @@ ## Open +### Crash-during-download leaves orphan archive files + +`crates/lanspread-peer/src/install/transaction.rs:329` — `recover_download_transients` +sweeps only `.version.ini.tmp` and `.version.ini.discarded` on startup. The new +cancel-cleanup (`download/storage.rs::discard_cancelled_download`) is only invoked +from the in-flight orchestrator, so a crash mid-download leaves partial `.eti` +archives in the game root. After restart the user sees a game that looks +half-downloaded with no way to clean it up except `RemoveDownloadedGame`. Closing +this would mean calling the same discard pass during recovery for any game root +whose intent is `None` and whose `version.ini` is absent. + +Not blocking. The cancel-button fix is correct in its scope; this is the symmetric +crash-recovery case. + ### `handleErrorEvent` still writes status fields directly `crates/lanspread-tauri-deno-ts/src/hooks/useGames.ts:80-89` — the error