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
Sign in to join this conversation.
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:
HttpOnly; SameSite=Lax; Securebrowser-id cookie (random, 128 bits) when it is absent.src/lobby.tsreads it on/liveupgrade, validates its shape, and gives each anonymous socket a guest name and colour fromguest-names.ts. Two browsers never hold one name at once, and a name is freed when its last socket closes.{type:'you', guest:{name, colour}}.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.bun --cwd Software/so101 testpasses.