Skip to content

Server: limit the number of titles in the score store - #165

Merged
undecuple merged 2 commits into
mainfrom
fork-score-titles
Nov 13, 2026
Merged

undecuple merged 2 commits into
mainfrom
fork-score-titles

Conversation

@undecuple

Copy link
Copy Markdown
Owner

Why

The in-memory score store limited the boards of one title (1000) and the players of one board (10000), but not the number of titles, so its size had no bound across titles. docs/running.md said so ("the number of titles is not limited").

Change

  • server/store/memory.go: the store keeps boards for at most 1000 titles (maxTitles). A Put that would start a board for a new title past that returns ErrFull, which the server already answers with ERROR 6 and a debug log line; the refusal creates nothing. A title that already has boards still takes new boards (up to its own limit), new players and better scores, and a player already on a board is never refused.
  • server/store/store.go: the ErrFull message and the Put comment name the title limit.
  • docs/api.md, docs/running.md and docs/integrating.md: the limits text now lists the title limit; the sentence that the number of titles is not limited is removed. CHANGELOG Server: entry under Fixed; site/ regenerated.
  • The limit is fixed, as the other two are; there is no flag.

Tests

  • server/store/memory_limit_test.go: the default is 1000 titles, 1000 boards per title and 10000 players per board; with a limit of 2, a third title is refused and leaves no title, board or entry behind, while an existing title still takes a new board, a new player and a better score; the limit counts titles, not boards.
  • gofmt, go vet, go test ./server/..., python3 tools/repo_check.py, python3 tools/site.py --check, python3 tools/features.py --check and scripts/check-deploy.sh pass.
  • Mutation-tested: no title check, an off-by-one limit, refusing new boards of existing titles, a different default, and refusing only after the board was created (which leaves a trace) each fail a test. Against main the new test does not build, because maxTitles does not exist there.

Not in this change

No flag, no change to the other two limits, no persistent store, and no change to how the server answers a refused score.

Overlap

None open on server/store. Other open work touches CHANGELOG.md and the generated site files, so whichever merges later needs a rebase. Based on main at 7fdd762.

Developed with AI agent assistance.

@undecuple
undecuple merged commit 9f3ba8d into main Nov 13, 2026
10 checks passed
@undecuple
undecuple deleted the fork-score-titles branch November 13, 2026 04:03
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