Repository navigation
Every game against Maia is held by the server: remove the browser-run path - #459
Merged
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ashtonanderson
marked this pull request as ready for review
December 3, 2026 01:07
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_gameand 7,456submit_moverequests):www.maiachess.com/play/maiareferrer in today's URL format, apart from five addresses running a development copy onlocalhost:3000. No old cached builds, no outside clients.useServerGames: a play page that hasn't had the account request's answer within 4 seconds plays the old way (so does a browser withmaia.serverGames = 0in 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.start_game), and creating a server-held game doesn't need the account answer (fetchAsGuestgets 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, theNEXT_PUBLIC_SERVER_GAMESand localStorage switches,serverGameson the accountstart_game(including the setup dialog's early request) andsubmit_movecalls, and the retry wrapper for Maia's move in a gameuseGameLog)StartGameConfirmModal): the server keeps every unfinished game and asks its own game-in-progress questionget_moveandget_book_movesstay: the opening drills use them.What a player notices
Checked
tsc,eslint src, andjest(103 suites, 669 tests) pass.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_moverequests 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/accountshould keep sendingserver_games: trueuntil then: older bundles read it.🤖 Generated with Claude Code