fix: show finished games on watch page instead of hanging spinner #16
Reference in New Issue
Block a user
Delete Branch "fix-finished-games"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
▎
▎ - Opening a finished game caused an infinite spinner because the NDJSON stream never delivers events for finished games — it just hangs waiting for events that will never come
▎ - Fix: fetch the full game state via REST on load (GET .../game/{gameId}), apply it to the board immediately, and only open the stream subscription if the game is still ongoing or pending
▎
▎ Changes
▎
▎ - tournament-watch.component.ts — REST fetch now drives the initial state; stream is only started conditionally; extracted applySnapshot(), isFinished(), subscribeToStream()
▎
▎ Test plan
▎
▎ - [ ] Finished game: board shows final position, correct status label, no spinner
▎ - [ ] Live game: board shows current position, stream updates continue to work
▎ - [ ] Pending game: stream starts and updates once the game begins
Previously, navigating to a finished game caused the watch page to spin forever because the stream never delivers events for finished games. Fix by fetching the full game state via REST on load (GET .../game/{gameId}), applying it immediately to the board, and only starting the stream subscription if the game is still ongoing or pending. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>