fix(peer): repair update lifecycle regressions
FINDINGS.md identified three merge blockers in the post-plan install/update flow. Updates now use FetchLatestFromPeers so the Tauri update command bypasses local manifest serving and asks peers that advertise the latest version for fresh file metadata. PeerGameDB now aggregates and validates file descriptions from latest-version peers, keeping stale cached metadata for older versions from poisoning chunk planning when filenames stay the same but sizes change. Download-to-install handoff now performs explicit async state transitions. The download task mutates Downloading to Installing or Updating under the active-operation write lock, clears the cancellation token, and then runs the install transaction. OperationGuard remains armed only as crash or abort cleanup and is disarmed after normal explicit cleanup, so final refreshes no longer race a deferred Drop cleanup. Local library index writers now serialize the load/mutate/save window with one async mutex. The index fingerprint also includes the root version.ini contents so a same-length version rewrite in the same mtime second still updates the reported local version. The tradeoff is that local index mutations are serialized in-process instead of moved into a dedicated actor. That keeps the fix small and scoped to the merge blockers while preserving the existing scanner API. Test Plan: - just fmt - just test - just clippy - just build - git diff --check Refs: - FINDINGS.md
This commit is contained in:
+3
-2
@@ -22,8 +22,9 @@
|
||||
Tauri by sending `PeerCommand::InstallGame` directly. A not-downloaded game
|
||||
still uses `GetGame`, and the peer auto-installs after the sentinel commit.
|
||||
- Removed the dead internal `PeerCommand::UpdateGame` path. The UI update button
|
||||
intentionally sends `GetGame`, and the peer infers install versus update from
|
||||
the presence of `local/` after archives are available.
|
||||
now sends `FetchLatestFromPeers`, which skips local manifest serving and asks
|
||||
latest-version peers for fresh file metadata before the normal download and
|
||||
update transaction runs.
|
||||
- Kept `Availability::Downloading` in the wire protocol for compatibility, but
|
||||
local summaries do not emit it today because active operations are gated out
|
||||
of scans and serving decisions.
|
||||
|
||||
Reference in New Issue
Block a user