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

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

Each anonymous /live viewer gets a stable guest name from src/guest-names.ts, keyed by an HttpOnly browser-id cookie - lobby and test only #396

shipped merged opened this has it
opened this

Replaces #362 unchanged in scope; #362 waited on #291, which was split, so the map held it. src/guest-names.ts (nameFor(browserId, inUse)) is on main in 30708a9. The page does not change.

Done:

  • [ ] The page GET sets an HttpOnly; SameSite=Lax; Secure browser-id cookie (random, 128 bits) when it is absent. src/lobby.ts reads it on /live upgrade, validates its shape, and gives each anonymous socket a guest name and colour from guest-names.ts. Two browsers never hold one name at once, and a name is freed when its last socket closes.
  • [ ] The socket is told its own name once: {type:'you', guest:{name, colour}}.
  • [ ] Tests in src/lobby.test.ts: two anonymous sockets with different cookies get different names, the same cookie gets the same name after a reconnect, and a malformed cookie is treated as absent.
  • [ ] forge.json untouched, and bun --cwd Software/so101 test passes.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs