Cap moves returned per move-feed request - #14
Conversation
🤖 Claude has reviewed this PR — expand after forming your own opinionCode Quality: The variable name Security: Negative or zero Performance: Minor — the cap is applied in PHP after the stored procedure returns all rows, so the database still does the full work. Not a concern at current scale, but if game lengths grow significantly, pushing a LIMIT into the stored procedure would avoid transferring unused rows. Testing: No test coverage for the new parameter (negative values, zero, absent, very large). If there is an integration test suite for this endpoint, consider adding cases for these edge inputs. |
The move-feed endpoint currently returns every pending move for a game in a single response. For long games this makes the JSON payload large and the polling client only consumes a window of moves at a time anyway.
This adds an optional
maxmovesquery parameter togetmovefeed.phpthat caps how many moves are returned, and has the game manager request a fixed batch size (movesPerRequest) on each poll. Behaviour is unchanged when the parameter is absent.