refactor(peer): split local library and operation UI events
Replace the `a9f9845` local-update dedup cache with explicit peer event semantics. Local scans now emit `LocalLibraryChanged` when the library changes, while operation mutations emit `ActiveOperationsChanged` from the mutation path. Tauri keeps joining those facts into the existing `games-list-updated` payload, so the frontend contract stays stable. This removes the cache/invalidation coupling between scan emission and operation state. The remaining forced local snapshot is explicit: accepted game directory changes can refresh the UI for an equivalent new path without sending a peer library delta. Operation guard cleanup and liveness cancellation now publish the same active operation snapshot as normal command-handler transitions. The peer CLI JSONL events follow the same split with `local-library-changed` and `active-operations-changed`. Test Plan: - `just fmt` - `CARGO_BUILD_RUSTC_WRAPPER= just test` - `CARGO_BUILD_RUSTC_WRAPPER= just clippy` - `git diff --check` Refs: CLEAN_CODE_PLAN_1.md
This commit is contained in:
@@ -77,6 +77,11 @@ When a peer is discovered:
|
||||
- an active operation lock drops events for that game;
|
||||
- a rescan already running for the ID sets a rescan-pending flag;
|
||||
- the running rescan loops once more when that flag was set.
|
||||
- Local library scans emit `LocalLibraryChanged` only for real library changes,
|
||||
except that accepted game-directory changes can force a UI snapshot for the
|
||||
new path without sending a peer delta.
|
||||
- Active operation mutations emit `ActiveOperationsChanged` from the mutation
|
||||
path instead of riding on local library scans.
|
||||
- Send `LibraryDelta` to known peers; send `LibrarySummary` on new connections.
|
||||
|
||||
## Local game scanning: fast and low cost
|
||||
|
||||
Reference in New Issue
Block a user