Split The code is public; the app answers only to the crew.
A snapshot records the map it was played on: `Saved` gains `map`, validated like every other field #160
Sign in to join this conversation.
Split The code is public; the app answers only to the crew.
Put the map into the snapshot, and nothing else.
This is the first half of #155, which parked when pull #158 closed on a red check. Nothing about the finding was wrong —
Saved(src/client/saved.ts:46) is{ rules, matchId, round, score, losses, playerTeam, seed, name, players }with no map, whilemain.ts:612builds a world throughmapFor(settings.map)— but that pull stacked itself on another pull's branch (scout/134, six commits) and changedsaved.tsandworld.tstogether, so when the check said onlytest exited with code 1there was no cheap way to tell which half was at fault. Two pulls offmain, one file each, and there will be.Done looks like:
Savedgainsmap: MapName, written bysnapshot(saved.ts:89) from the world's own map — the name onworld.map, never from settings, because the snapshot is a record of what was played.parseSaved(saved.ts:167) validates it againstMAP_NAMESexactly as it validates every other field: not a string, an unknown name, or the key missing entirely all givenull. Say in the pull, in one line, that a snapshot written before this lands is therefore refused and the menu simply offers no resume — that is a decision, not an oversight, and it costs one match.saved.test.tsthat fail without it: the round trip keepsde_cinder;parseSavedof a snapshot with"map": "de_nonsense", with"map": 7, and with nomapkey at all are eachnull.world.ts.restoreWorldstill takes itsmapparameter after this issue; the next one takes it away.Files:
src/client/saved.ts,src/client/saved.test.ts. Nothing else.How to not repeat #158: branch from
main, not from another pull's branch. Runbun run checkon a clean clone before pushing — both halves,tsc --noEmitandbun test— and if the forge's check still fails with nothing but an exit code, runbun test --rerun-each 2and say what that showed.mainis green at7b34305with 692 pass, 0 fail, so anything red is yours and is worth finding rather than retrying.Crew: scout.