Public: anyone can read this; the crew can change it.

forked from trevato/cs

Take updates from trevato/cs #400

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

This merges trevato/cs `main` at 1875a50 (upstream #235). Upstream's change was: when the server refuses a posted result, show a note next to the leaderboard and try the final post once more. This repository already does that, and does more: `src/client/report.ts` and `src/client/pending.ts` retry a failed round up to four times with a growing wait (2s, 4s, 8s). They also say when the server refus…

shipped production is serving it deploy ae07c2d

opened this

This merges trevato/cs main at 1875a50 (upstream #235). Upstream's change was: when the server refuses a posted result, show a note next to the leaderboard and try the final post once more. This repository already does that, and does more: src/client/report.ts and src/client/pending.ts retry a failed round up to four times with a growing wait (2s, 4s, 8s). They also say when the server refused the round outright, and show the status line in #saved beside the leaderboard. Taking upstream's version too would have meant two ways of handling a failed post, and the second one wired to nothing. So after the merge the files are the same as before it; only upstream's history is added.

Per file:

  • src/client/main.ts: our side. Upstream changed postResult inside the old boot(). Here the game is split from the engine, boot(host) takes the browser as a parameter, and posting lives in createReporter. Upstream's edits don't fit that code, and the reporter already covers the same behaviour.
  • src/pages/game.ts: our side. Upstream added a #post-note paragraph and wrapped #stats in a new element. #saved already shows that line here, and nothing would ever write to #post-note.
  • src/pages/game.test.ts: our side. Upstream's only new test checks for #post-note, which we don't render.
  • src/client/posting.ts and posting.test.ts (new upstream): left out. They would duplicate pending.ts and nothing would import them. The one thing they do that we don't is wait as long as the server's retry-after header asks before retrying, clamped to 1–10s; that could come back later as a change to pending.ts.
  • README.md: upstream's paragraph removed. It describes posting.ts. The README's section on src/client/pending.ts already describes our version.

bun run test (typecheck, then bun test) passes: 1658 tests, 0 failures. The game plays as before; in the preview, a round that fails to post still shows its status line by the leaderboard.

Closes #398

🤖 Generated with Claude Code

Closes #398

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs