Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
/live sends everyone a coalesced presence frame {type:'presence', here, signedIn, watching} within 1 s of a connect or disconnect - lobby and test only #368
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
/live now sends a coalesced presence frame, {type:'presence', here, signedIn, watching}. Only lobby.ts and lobby.test.ts changed. The 44 lobby tests pass.
shipped merged
/live now sends a coalesced presence frame, {type:'presence', here, signedIn, watching}. Only lobby.ts and lobby.test.ts changed. The 44 lobby tests pass. I couldn't run bun x tsc --noEmit: bun reported unable to write files to tempdir: ReadOnlyFileSystem. The type check is therefore unverified here, and the forge's check will be the first to run it.
- Counts:
hereis every open/livesocket.signedIncounts each person once by their id, so two tabs of one person count once.watchingis the sockets with no identity. - Privacy: the frame carries counts only, no names and no addresses.
- Timing: a connect or disconnect starts a 1 s timer, and the frame goes to everyone when it fires. Further changes inside that second add nothing, so a burst of connects is one frame. A new socket also gets the current counts at once. A new
presenceMsoption sets the window, and the tests use 60 ms. The timer is cleared inclose(). - Tests: the new
lobby presenceblock covers the counts rising on connect and falling on disconnect, two tabs of one person counting once with no name in the frame, and a burst of five connects giving the existing watcher one frame.
🤖 Generated with Claude Code
Does what the issue asks, lobby and test only. The frame is counts only (no names or addresses). Two tabs of one person count once, and here and watching are right. The timer is unref-ed and cleared in close(). I could not run the new tests on this head here, and the type check is still unverified, so the forge check is the first to run it. Two things I would do next: (1) the burst test starts its 60 ms window at the watcher own connect, so on a slow machine the frame can land mid-burst and give [1,3,6]. Make it wait for a presence frame with here:6 and assert there were fewer than six frames, or widen presenceMs for that test. (2) The page and the terminal do not show the counts yet. That is fine for this pull, but it needs its own small pull so both doors get it, with a README line.
/livenow sends a coalesced presence frame,{type:'presence', here, signedIn, watching}. Onlylobby.tsandlobby.test.tschanged. The 44 lobby tests pass. I couldn't runbun x tsc --noEmit: bun reportedunable to write files to tempdir: ReadOnlyFileSystem. The type check is therefore unverified here, and the forge's check will be the first to run it.hereis every open/livesocket.signedIncounts each person once by their id, so two tabs of one person count once.watchingis the sockets with no identity.presenceMsoption sets the window, and the tests use 60 ms. The timer is cleared inclose().lobby presenceblock covers the counts rising on connect and falling on disconnect, two tabs of one person counting once with no name in the frame, and a burst of five connects giving the existing watcher one frame.🤖 Generated with Claude Code
Closes #358