fix(peer): refresh settled install state after operations

The follow-up review found a few stale lifecycle edges around local game
transactions. Recovery could sweep active roots, post-operation refreshes
still re-ran full startup recovery, and the UI kept inferring local-only state
from downloaded and installed flags instead of the backend availability.

This updates the peer lifecycle so startup recovery skips active operations,
install/update/uninstall refresh only the affected game after the operation
guard is dropped, and path-changing game-directory updates are rejected while
operations are active. It also removes the dead UpdateGame command, drops the
unused manifest_hash write field while preserving old JSON reads, renames the
internal install-finished event, and carries availability through the DB,
peer summaries, Tauri refreshes, and the React model.

The included follow-up documents record the review source, implementation
decisions, and the remaining FOLLOW_UP_2.md work so later commits can stay
small instead of reopening the completed plan items.

Test Plan:
- git diff --check
- just fmt
- just clippy
- just test

Follow-up-Plan: FOLLOW_UP_PLAN.md
This commit is contained in:
2026-05-16 08:50:51 +02:00
parent fce34c7bd2
commit b5d20c1e72
22 changed files with 1389 additions and 131 deletions
-6
View File
@@ -58,7 +58,6 @@ use crate::{
handle_list_games_command,
handle_set_game_dir_command,
handle_uninstall_game_command,
handle_update_game_command,
load_local_library,
},
};
@@ -159,8 +158,6 @@ pub enum PeerCommand {
},
/// Install already-downloaded archives into `local/`.
InstallGame { id: String },
/// Update an installed game from already-downloaded archives.
UpdateGame { id: String },
/// Remove only the `local/` install for a game.
UninstallGame { id: String },
/// Set the local game directory.
@@ -291,9 +288,6 @@ async fn handle_peer_commands(
PeerCommand::InstallGame { id } => {
handle_install_game_command(ctx, tx_notify_ui, id).await;
}
PeerCommand::UpdateGame { id } => {
handle_update_game_command(ctx, tx_notify_ui, id).await;
}
PeerCommand::UninstallGame { id } => {
handle_uninstall_game_command(ctx, tx_notify_ui, id).await;
}