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

The game map says which way it failed: not listening, too large, too slow or refused by BlueMap #18347

opened this

Merged 39m ago, live in production

The game map now says which way it failed, and a viewer is only sent to reinstall BlueMap when BlueMap isn't listening. test/games-map.test.ts, tsc and scripts/gate.ts --fix pass. I didn't run the rest of the suite, because scripts/fast.ts found the change too broad to narrow down.

Notes

opened this

The game map now says which way it failed, and a viewer is only sent to reinstall BlueMap when BlueMap isn't listening. test/games-map.test.ts, tsc and scripts/gate.ts --fix pass. I didn't run the rest of the suite, because scripts/fast.ts found the change too broad to narrow down. The forge's check runs it on this push. Nothing was run against a live BlueMap.

What changed

  • Agent (src/games/agent.sh): map_start now reads curl's exit code. Exit 7 is sent as refused, 63 as toobig and 28 as slow. Any other HTTP status still goes as status NNN.
  • Forge (src/games/map.ts, src/games/map_words.ts): askMap maps each answer to its own status and sentence:
AnswerStatusSentence
refused502Today's not-listening sentence, with the install hint
toobig502Larger than the 600 KB the box relays (no install hint)
slow504Took longer than 10 s (no install hint)
status 404404Not on the map
status 403, 5xx and other codes502BlueMap refused the file, with its status
  • Old agents: a bare status 000 from an agent that isn't updated still gets today's not-listening sentence. An unrecognised answer also gets that sentence.
  • Doors: the web page and the terminal both read askMap's sentence, so both show the new wording. The commit says No door: because neither surface changed shape.
  • Docs: docs/features/game-map.md describes the four reasons.
  • Test: one new case in test/games-map.test.ts covers refused, an old status 000, toobig, slow and status 403. Each fails without the change.

Left out

  • toobig and refused share status 502. I didn't pick a more specific code, such as 413, because it would mislead the browser.
  • The release scripts are untouched. I added no new function and no dependency.

Closes #18343

commented

The game map now says which way it failed, and a viewer is only sent to reinstall BlueMap when BlueMap isn't listening. test/games-map.test.ts, tsc and scripts/gate.ts --fix pass. I didn't run the rest of the suite, because scripts/fast.ts found the change too broad to narrow down. The forge's check runs it on this push. Nothing was run against a live BlueMap.

What changed

  • Agent (src/games/agent.sh): map_start now reads curl's exit code. Exit 7 is sent as refused, 63 as toobig and 28 as slow. Any other HTTP status still goes as status NNN.
  • Forge (src/games/map.ts, src/games/map_words.ts): askMap maps each answer to its own status and sentence:
AnswerStatusSentence
refused502Today's not-listening sentence, with the install hint
toobig502Larger than the 600 KB the box relays (no install hint)
slow504Took longer than 10 s (no install hint)
status 404404Not on the map
status 403, 5xx and other codes502BlueMap refused the file, with its status
  • Old agents: a bare status 000 from an agent that isn't updated still gets today's not-listening sentence. An unrecognised answer also gets that sentence.
  • Doors: the web page and the terminal both read askMap's sentence, so both show the new wording. The commit says No door: because neither surface changed shape.
  • Docs: docs/features/game-map.md describes the four reasons.
  • Test: one new case in test/games-map.test.ts covers refused, an old status 000, toobig, slow and status 403. Each fails without the change.

Left out

  • toobig and refused share status 502. I didn't pick a more specific code, such as 413, because it would mislead the browser.
  • The release scripts are untouched. I added no new function and no dependency.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs