fix(peer): preserve untracked download files
Reject exact manifest destinations that are not covered by the last committed ownership set before creating a baseline or parking version.ini. Align Windows device-name validation with the confined filesystem backend and keep cleanup capability-relative. Replace recursive downloaded-game removal with an empty ownership generation. The operation now removes only proven-owned files and the sentinel, preserves unknown files and directories, and remains recoverable and idempotent across crashes. Test Plan: - just clippy - just test - just fmt (Rust, TOML, and Prettier completed; rumdl still reports 39 pre-existing issues)
This commit is contained in:
@@ -127,22 +127,22 @@ as the single source of truth for whether a download is still running.
|
||||
|
||||
### Install Transactions
|
||||
|
||||
Install, update, uninstall, downloaded-file removal, and startup recovery live
|
||||
under `src/install/`. Install-side operation intent is stored atomically under
|
||||
the configured peer state directory, at `games/<game_id>/install_intent.json`.
|
||||
Game roots still use Lanspread-owned `.local.installing/` and `.local.backup/`
|
||||
Install, update, uninstall, and install-side startup recovery live under
|
||||
`src/install/`. Install-side operation intent is stored atomically under the
|
||||
configured peer state directory, at `games/<game_id>/install_intent.json`. Game
|
||||
roots still use Lanspread-owned `.local.installing/` and `.local.backup/`
|
||||
directories marked by `.lanspread_owned`. Startup recovery combines the recorded
|
||||
intent with the observed filesystem state and only deletes reserved directories
|
||||
when intent or marker ownership proves they belong to Lanspread. Downloaded-file
|
||||
removal is deliberately separate from uninstall: it only accepts catalog IDs
|
||||
that are direct children of the configured game directory, refuses installed or
|
||||
in-flight roots, and deletes the whole game root only after finding a regular
|
||||
root-level `version.ini` sentinel.
|
||||
when intent or marker ownership proves they belong to Lanspread.
|
||||
|
||||
Download provenance is stored separately at
|
||||
`games/<game_id>/download_ownership.json` in the peer state directory. It is
|
||||
bound to the canonical configured games directory so switching library roots
|
||||
cannot make an old record authorize deletion in a different tree.
|
||||
cannot make an old record authorize deletion in a different tree. Downloaded-
|
||||
file removal is deliberately separate from uninstall: it refuses installed or
|
||||
in-flight roots, journals an empty pending generation, and deletes only the
|
||||
regular sentinel plus paths proven by the last committed ownership set. Unknown
|
||||
files, directories, and the game root remain untouched.
|
||||
|
||||
Legacy launcher-owned files in game directories are migrated by a dedicated
|
||||
pre-start phase. Normal install, recovery, scan, and transfer paths use only the
|
||||
|
||||
Reference in New Issue
Block a user