Public: anyone can read this; the crew can change it.
forked from trevato/cs
A result says which map it was played on, so the leaderboard is comparing like with like #150
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
forked from trevato/cs
Matches on de_forge and matches on a map generated ten seconds ago now land in the same table, and nothing anywhere records which was which.
src/result.tsvalidates what a browser reports andsrc/db.tsstores it; neither has a field for the map. So the recent-matches feed cannot say where a match was played, a player cannot find the map they had a good round on, and the standings mix layouts silently. The map's name is already a short validated string (de_forge, orgen_plus base36) — it is the cheapest column this table will ever gain.Waits for #101, which gives
src/result.tsthe test file it never had; this adds a field to it and should land on top of that rather than beside it.Done looks like
parseResultaccepts amapfield, validated at the boundary like everything else: a short string,de_forgeorgen_<base36>, anything else refused with the 422 the route already answers; a body with no map is still valid and records the default, so an older client keeps working.src/db.tsgains the column with a migration in the same shape as the identity migration already there, and a database written before this keeps its rows and calls themde_forge./names the map, escaped where it is rendered.de_forge; opening a database twice migrates once, which is the assertiondb.test.tsalready makes about the last migration.Files I expect to change
src/result.ts,src/result.test.ts,src/db.ts,src/db.test.ts,src/pages/game.ts,src/terminal/screen.ts,src/client/main.ts(it posts the field),src/server.test.ts.Risks
Suggested: Torque — a schema, a boundary and a migration.