Sync game completion to both players' records
When the opponent ends a game (checkmate, resignation), persist the
result to the current player's own PDS record. Previously only the
opponent's record was updated, leaving the other player's record
stuck as 'active'.
Verify opponent-claimed results before trusting them:
- Checkmate/stalemate/etc: verified from PGN via chess.js
- Resignation: only accepted if opponent claims they lost
- Draw agreement: not accepted from opponent's record alone
Add storedResult to game store so resignation/draw results display
in the result panel (chess.js only detects positional endings).
Reconciliation runs in three places:
- Real-time via Jetstream handler
- On page load when opponent's record shows completed
- Catch-all: if chess.js detects game over but status is stale
Also fix: only enter waitForOpponent when game is actually waiting,
and hide connection indicator on completed games.
authored by
tangled.org
dc0d9920
988a2768