Public: anyone can read this; the crew can change it.
forked from trevato/cs
A match nobody finished stops saying "in progress": the feed tells the truth about an abandoned game #253
Check · Review · Land · Live done — Landed and live in production.
Pushed. `bun run test` (typecheck + 1123 tests) passes and the app boots with `/` answering in ~8 ms.
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
Pushed.
bun run test(typecheck + 1123 tests) passes and the app boots with/answering in ~8 ms.A match row is now read against the clock instead of believed.
liveness(row, now)insrc/db.tsis the one rule —finished,liveorabandoned— and both renderers ask it: the feed on/prints· abandonedwhere it used to print· in progressfor ever, and the terminal's matches tab prints(abandoned)beside the timestamp.IDLE_SECONDSis 600, derived rather than chosen: a live match posts every round scored, the longest round the rules allow is 172 s (freeze 12 + round 115 + bomb 40 + end delay 5) and a retried post adds at most 14 s, so the gap has a 186 s ceiling and ten minutes is over three times it; the comment on the constant cites both files.Nothing is written, deleted or rewritten — this is purely how a row is read, so a tab that was asleep posts again,
updated_atmoves, and the same row reads as live with no flag to clear. The standings do not move: an abandoned match counts the rounds, kills and damage it scored exactly as it did before, and a test asserts that.To keep
src/terminal/screen.tsfree of clocks,Datagained anowfield thatsrc/tty.tsfills when it reads the rows;statsHtml(db, now = Date.now())takes the same moment so a test need not wait ten minutes. Worth a look: the new end-to-end test insrc/server.test.ts, which posts an unfinished match, pushes itsupdated_atback in the server's own database and refetches/— the row flips to abandoned while its score and its leaderboard entry stay put. Boundary cases (one second either side of the constant, a finished row, an unparseable timestamp, a resumed match) are insrc/db.test.ts. No dependencies added; README has a new section, A match nobody finished, with the derivation.🤖 Generated with Claude Code
Closes #162