Skip to content

Every game against Maia is held by the server: remove the browser-run path - #459

Merged
ashtonanderson merged 1 commit into
mainfrom
claude/retire-browser-games
Dec 3, 2026
Merged

ashtonanderson merged 1 commit into
mainfrom
claude/retire-browser-games

Conversation

@ashtonanderson

Copy link
Copy Markdown
Member

Why

The server has held every player's games since the rollout share reached 100% (hand and brain games: all of them since 22 November). Play games are at 99.6%: about 30 a day, 213 in the week to 2 December from 20 accounts, were still run by the browser and reported with start_game / submit_move.

Where those come from (nginx logs, 25 November to 2 December; 256 start_game and 7,456 submit_move requests):

  • All of them come from this site's own fallback in the current build: every request has a www.maiachess.com/play/maia referrer in today's URL format, apart from five addresses running a development copy on localhost:3000. No old cached builds, no outside clients.
  • The fallback is useServerGames: a play page that hasn't had the account request's answer within 4 seconds plays the old way (so does a browser with maia.serverGames = 0 in localStorage). 13 of the 20 accounts also played server-held games in the same week, mostly on the same days, which is what an occasional slow or failed account request looks like.
  • The fallback bought nothing: a browser-run game needs the server just as much (start_game), and creating a server-held game doesn't need the account answer (fetchAsGuest gets the guest cookie on a 401 by itself).

What changes

A play page always creates its game on the server, and the code that ran a game in the browser is removed (about 1,900 lines):

  • useServerGames, the NEXT_PUBLIC_SERVER_GAMES and localStorage switches, serverGames on the account
  • the start_game (including the setup dialog's early request) and submit_move calls, and the retry wrapper for Maia's move in a game
  • in the play controllers: asking for Maia's moves, the local flag, rules and resignation endings, local takebacks and extra time, the game log (useGameLog)
  • unlimited and practice games kept in localStorage to be continued, and the question before starting a game from a link (StartGameConfirmModal): the server keeps every unfinished game and asks its own game-in-progress question

get_move and get_book_moves stay: the opening drills use them.

What a player notices

  • Nothing, in a normal game.
  • With a slow or failed account request, the game now starts as a server-held game instead of a browser-run one.
  • A browser holding an unfinished browser-run unlimited or practice game in localStorage is no longer offered "Continue" for it. Those games stay unfinished on the backend (about a handful of players).

Checked

  • tsc, eslint src, and jest (103 suites, 669 tests) pass.
  • Not checked: a click-through of a play, hand, brain and practice game in a browser. That is worth doing on this PR's preview before merging.

Rolling back

Revert this PR: the backend still serves the old routes.

Next stage (backend, not in this PR)

Once this has been live long enough that start_game / submit_move requests have stopped (open tabs keep the old bundle until reloaded), the backend can drop those two routes, the rollout share, and the sweep that ends browser-run games. /auth/account should keep sending server_games: true until then: older bundles read it.

🤖 Generated with Claude Code

…s removed

The server has held every player's games since the share reached 100%, but
the site still fell back to running a game in the browser (start_game,
get_move, submit_move) when the account request hadn't answered within four
seconds, or when a browser had opted out in localStorage. About 30 play games
a day still went that way, from some 20 accounts.

Now a play page always creates its game on the server (the request gets the
guest cookie by itself if it is missing), and the code that ran a game in the
browser is gone:

- useServerGames, the build and per-browser switches, and `serverGames` on
  the account
- start_game (also the setup dialog's early request) and submit_move calls,
  and the retry wrapper for Maia's move in a game
- in the play controllers: asking for Maia's moves, the local clock flag,
  rules and resignation endings, local takebacks and extra time, the game log
- unlimited and practice games kept in localStorage to be continued (the
  server keeps every unfinished game), and the question before starting a
  game from a link (the server's game-in-progress question covers it)

get_move stays: the opening drills use it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
maia-platform-frontend Ready Ready Preview Dec 3, 2026 1:05am UTC

Request Review

@ashtonanderson
ashtonanderson marked this pull request as ready for review December 3, 2026 01:07
@ashtonanderson
ashtonanderson merged commit 86ebcfc into main Dec 3, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — ba43a8bd Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant