feat(lobby): cap simultaneous quick games at 10 #76

Merged
developer merged 1 commits from feature/quick-game-limit into development 2026-06-16 21:00:41 +00:00
Owner

Caps a player at 10 active quick games (auto-match + AI; friend games created by invitation are not counted).

  • At the cap the backend refuses both new-game entry points — POST /lobby/enqueue and POST /invitations — with 409 game_limit_reached; accepting an invitation is never gated, so friend games are capped from the other end.
  • The lobby disables New Game (greyed) and shows a plain, low-emphasis notice, driven by a new at_game_limit flag on games.list (no per-event payload — a turn change does not move the count, and the lobby already re-fetches games.list on entry and every game event).
  • Counting (game.Service.CountActiveQuickGames): active/open quick seats, excluding invitation-linked friend games; hidden games still occupy a slot (dedicated count).

No schema change (only a trailing FB field, no migration) → no contour DB wipe.

Tests: backend integration (count rule + HTTP gate 409 + accept bypass), server unit (error map), gateway transcode round-trip, UI codec + lobbycache unit, e2e (gamelimit.spec.ts). Local full suite green (Go unit+integration, UI check/unit/build/bundle/e2e Chromium+WebKit).

Docs: PRERELEASE (GL), FUNCTIONAL (+_ru), ARCHITECTURE §8, UI_DESIGN, backend/README.

Caps a player at **10 active quick games** (auto-match + AI; friend games created by invitation are **not** counted). - At the cap the backend refuses both new-game entry points — `POST /lobby/enqueue` and `POST /invitations` — with **409 `game_limit_reached`**; **accepting** an invitation is never gated, so friend games are capped from the other end. - The lobby disables **New Game** (greyed) and shows a plain, low-emphasis notice, driven by a new `at_game_limit` flag on `games.list` (no per-event payload — a turn change does not move the count, and the lobby already re-fetches `games.list` on entry and every game event). - Counting (`game.Service.CountActiveQuickGames`): `active`/`open` quick seats, excluding invitation-linked friend games; hidden games still occupy a slot (dedicated count). No schema change (only a trailing FB field, no migration) → **no contour DB wipe**. Tests: backend integration (count rule + HTTP gate 409 + accept bypass), server unit (error map), gateway transcode round-trip, UI codec + lobbycache unit, e2e (`gamelimit.spec.ts`). Local full suite green (Go unit+integration, UI check/unit/build/bundle/e2e Chromium+WebKit). Docs: PRERELEASE (**GL**), FUNCTIONAL (+`_ru`), ARCHITECTURE §8, UI_DESIGN, backend/README.
developer added 1 commit 2026-06-16 20:51:54 +00:00
feat(lobby): cap simultaneous quick games at 10
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 49s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m8s
63ab85a5e5
Limit a player to 10 active quick games (auto-match + AI); friend games created
by invitation are not counted. At the cap the backend refuses both new-game
entry points — quick enqueue and invitation creation — with 409
game_limit_reached, while accepting an incoming invitation stays allowed, so
friend games are capped from the other end. The lobby disables "New Game" and
shows a low-emphasis notice, driven by a new at_game_limit flag on games.list
(no per-event payload: a turn change does not move the count, and the lobby
already re-fetches games.list on entry and every game event).

- game.MaxActiveQuickGames + Store/Service.CountActiveQuickGames (active/open
  seats, no game_invitations row; hidden games still count -> dedicated count)
- Server.ensureUnderGameLimit gating handleEnqueue + handleCreateInvitation;
  game.ErrGameLimitReached -> 409 game_limit_reached
- FB GameList.at_game_limit (regenerated Go + TS) through the gateway transcode
  and UI codec; gameListDTO + lobbycache snapshot + Lobby.svelte + i18n
- tests: integration count rule + HTTP gate + accept bypass; server error map;
  gateway transcode round-trip; UI codec + lobbycache unit; e2e gamelimit
- docs: PRERELEASE (GL), FUNCTIONAL(+ru), ARCHITECTURE 8, UI_DESIGN, backend README
owner approved these changes 2026-06-16 21:00:00 +00:00
developer merged commit d53ff18a67 into development 2026-06-16 21:00:41 +00:00
developer deleted branch feature/quick-game-limit 2026-06-16 21:00:41 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#76