Commit Graph

14 Commits

Author SHA1 Message Date
ddidderr be196f9e4b refactor: type game availability state
Game::availability used string labels that were carried through persisted
library data, protocol summaries, and the Tauri-facing game payload. That
allowed invalid states to exist and required legacy summary conversion code to
defensively map strings back into protocol availability values.

Move Availability to lanspread-db and re-export it from lanspread-proto so the
persisted Game type and wire GameSummary type share one serde enum. The JSON
spelling stays Ready, Downloading, or LocalOnly, so the serialized shape does
not change for current library indexes or peer payloads.

Add typed helpers for sentinel-derived download state. Game::set_downloaded
keeps downloaded and Ready/LocalOnly in lockstep and intentionally collapses
non-ready local state, including Downloading, back to LocalOnly. That matches
the current local-summary contract where active operations are suppressed
instead of advertised as Downloading. Game::normalized_availability keeps the
legacy Game-to-summary path from publishing an inconsistent Ready value when
downloaded is false.

Update the follow-up status note so typed availability is no longer listed as
open work.

Test Plan:
- just fmt
- just test
- just clippy
- just build

Refs: none
2026-05-16 11:49:01 +02:00
ddidderr b5d20c1e72 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
2026-05-16 08:50:51 +02:00
ddidderr b4585b663a ChatGPT Codex 5.5 xhigh refactored even more 2026-05-02 15:31:37 +02:00
ddidderr ec2a2ef44d windows paths 2025-11-14 10:11:11 +01:00
ddidderr 833c8afedf game thumbnails 2025-11-14 09:03:05 +01:00
ddidderr 8fe68f9574 wip 2025-11-13 21:43:20 +01:00
ddidderr 2d7f7513ad peer count for all games 2025-11-13 19:38:21 +01:00
ddidderr 6845a7d6fe wip 2025-11-08 17:27:01 +01:00
ddidderr 3b19cb8b18 clippy: apply and fix new lints 2025-08-17 16:35:54 +02:00
ddidderr 61a41c7122 clippy: add same lints to all crates 2025-08-17 16:12:42 +02:00
ddidderr adf6f9d757 [code] improve structure (focus: server) 2025-03-02 13:06:18 +01:00
ddidderr b21091c247 [code] edition 2024 2025-03-02 13:05:01 +01:00
ddidderr d1eb185498 [deps] move all deps into main toml and update 2024-12-03 20:49:13 +01:00
ddidderr 1388bc2115 [feat] use eti game.db, commit not working, something is wrong with game.id in the client/frontend 2024-11-12 22:12:49 +01:00