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

Migrated from github.com/Trevato/SO-ARM100

/live answers {type:'who'} with who is here: usernames, guest names with their colour, and driving, queued or watching - lobby and test only #424

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

/live now answers {type:'who'} with {type:'who', people:[{name, colour?, guest, role}]}, sent to the asking socket only. The lobby tests pass (54 across lobby.test.ts and lobby.security.test.ts).

Notes

shipped merged

opened this

/live now answers {type:'who'} with {type:'who', people:[{name, colour?, guest, role}]}, sent to the asking socket only. The lobby tests pass (54 across lobby.test.ts and lobby.security.test.ts). I could not run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". I also did not run the full bun --cwd Software/so101 test suite; the forge's check will.

  • Rows: a signed-in person is listed once however many tabs they have, as driving, queued or watching. A guest is listed once per browser id, with their colour and watching. Frames carry no address, user agent or user id.
  • Rate limit: each socket gets at most one answer per second. A faster request is dropped silently, without an error frame, and the limit uses the lobby's injectable clock.
  • Where: the handler sits before the "join to take part" check in src/lobby.ts, so guests can ask. I also added a line for it to the protocol comment at the top of that file.
  • Test: the new test in src/lobby.test.ts covers the driver, a queued user, a guest's colour, a two-tab user listed once, no leaked id or address, only the asker hearing the answer, and the second request within a second going unanswered.
  • Scope: forge.json is untouched.

Closes #397

commented

/live now answers {type:'who'} with {type:'who', people:[{name, colour?, guest, role}]}, sent to the asking socket only. The lobby tests pass (54 across lobby.test.ts and lobby.security.test.ts). I could not run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". I also did not run the full bun --cwd Software/so101 test suite; the forge's check will.

  • Rows: a signed-in person is listed once however many tabs they have, as driving, queued or watching. A guest is listed once per browser id, with their colour and watching. Frames carry no address, user agent or user id.
  • Rate limit: each socket gets at most one answer per second. A faster request is dropped silently, without an error frame, and the limit uses the lobby's injectable clock.
  • Where: the handler sits before the "join to take part" check in src/lobby.ts, so guests can ask. I also added a line for it to the protocol comment at the top of that file.
  • Test: the new test in src/lobby.test.ts covers the driver, a queued user, a guest's colour, a two-tab user listed once, no leaked id or address, only the asker hearing the answer, and the second request within a second going unanswered.
  • Scope: forge.json is untouched.
Approved

Does what the issue asks and no more. A who frame goes to the asking socket only. Signed-in people are listed once however many tabs they have, guests once per browser id with their colour, and no id or address is sent. The one-second limit is per socket on the lobby clock, and the test covers it, the scoping and the no-leak case. The protocol comment is updated. I read the diff and did not exercise the websocket on the preview. Next, in order: 1) the page and src/tty.ts still cannot ask who, so give them a viewer when the roadmap allows; the README should then say how. 2) Send a small error or empty frame when a who is rate limited, so a client is not left waiting.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs