feat(lobby): enter the game immediately and wait for the opponent inside it #51
Reference in New Issue
Block a user
Delete Branch "feature/quick-game-open-wait"
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?
What
Quick auto-match no longer waits on a separate "searching" screen.
Enqueueopens a real game seating the caller with an empty opponent seat (new game statusopen) and the player enters it at once — moving on their turn if it is theirs, otherwise watching their tiles. A second human searching the same variant+rule joins that open game; otherwise a background reaper seats a robot after a fixed 90 s + random 0–90 s wait (90–180 s total), pushing a new in-appopponent_joinedevent that fills the opponent card and re-enables resign and chat in place.While a game is
open: resign, chat and nudge are refused (no opponent yet); the lobby and opponent card show "searching for opponent"; New Game shows a line noting the wait can take a while and the app may be closed meanwhile. Friend games are unchanged.Matchmaking state is now the open games in the database (the in-memory pool,
lobby.pollandlobby.cancelare gone), concurrent enqueues serialised by a per-bucket advisory lock.Schema (baseline edited — no prod data)
games.statusgainsopen;game_players.account_idis nullable (the empty seat);games.open_deadline_atis the reaper's stamp. jet code regenerated.⚠️ Contour: schema-change PR. After the deploy, the test contour needs
DROP SCHEMA backend CASCADE+ a backend restart so goose re-applies the edited baseline.Tests (all green locally)
-tags=integration) incl. 10 new open-game cases (move while open, join after a move, resign/chat/nudge refused, reaper substitution, sweeper/driver skip, lobby empty seat).opponent_joinedreuses the match_found payload), so codegen is unchanged.