Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
A restart costs a blink, not a session: turn, queue and chat survive it and the page reconnects in under a second #453
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
Most of #440 was already on main. The missing piece was how fast the page retries, so I changed that and added the restart test. Already on main: Turns writes the driver, the queue order, names and turn times to turns.json and restores them on start.
shipped merged
Most of #440 was already on main. The missing piece was how fast the page retries, so I changed that and added the restart test.
Already on main:
Turnswrites the driver, the queue order, names and turn times toturns.jsonand restores them on start. The driver keeps the sameendsAt, so the remaining time is intact.- Chat, mutes and moderation, the admin settings and a held arm are also restored from the data directory.
- A lost relay link still parks the arm. The turn is restored with
readyBy: null, so the driver's next command needs no extra click. - Nothing in the 3D model path depends on the socket, so it needs no reload. Cameras reopen their own sockets.
Changed:
/liveretry:backoffinsrc/ui/lobby-panel.jsnow runs 100, 200, 400, 800, 1600, then 2000 ms. It was 250 ms to 2 s. The "reconnecting…" chip was already a small tag in the header that never covers the camera.- Camera feed retry:
RETRY_MSinsrc/ui/video.jsdrops from 500 to 100 ms. - Seat: the seat is the browser id cookie or the signed identity, and it was already kept across reconnects. I did not change it.
- Updated test:
src/ui/lobby-panel.test.tsnow expects the new delays.
New test, src/restart-session.test.ts:
- A signed-in driver takes a turn through the real relay and a fake arm server.
- The relay and lobby are closed and started again on the same port and data directory.
- The driver reconnects to
/liveand is still the driver with the sameendsAt. - A stamped
/followframe then reaches the fake bus as a goal write with no extra step. - The reconnect, turn check and goal write finish in under 1 s. The test caps the old relay's shutdown at 500 ms, which Bun's
node:httpneeds to avoid hanging.
I ran the src/ui tests, lobby.test.ts, relay-restart.test.ts and the new test: all 208 pass. tsc --noEmit reports the same 32 errors as before my change, and none are in files I touched. I did not run the full suite or design-lint.
Approved. The change is small and does what the issue asks. The /live backoff now runs 100/200/400/800/1600/2000 ms, and the camera RETRY_MS drops to 100 ms. The restart test boots the real relay twice on the same port and data directory and checks that the driver keeps the same turn (same endsAt). It then checks that a stamped /follow frame reaches the arm, all inside 1 s. The existing lobby-panel tests are updated to the new delays. The preview answers 200 on /. I did not run the tests or see a restart on the preview. No new dependencies, no security surface touched.
Two things I would do next:
- The
< 1000ms assertion in restart-session.test.ts depends on wall-clock time and can flake on a loaded CI machine. Assert on the order of events, or give it more headroom, and keep the 1 s target as a measured number rather than a pass/fail line. - Retrying every 100 ms for the first attempts on both /live and the cameras could pile up if the relay stays down for a long time. Add a little jitter, or a longer cap for the camera retry, so a restart with many viewers does not produce a reconnect burst.
Most of #440 was already on main. The missing piece was how fast the page retries, so I changed that and added the restart test.
Already on main:
Turnswrites the driver, the queue order, names and turn times toturns.jsonand restores them on start. The driver keeps the sameendsAt, so the remaining time is intact.readyBy: null, so the driver's next command needs no extra click.Changed:
/liveretry:backoffinsrc/ui/lobby-panel.jsnow runs 100, 200, 400, 800, 1600, then 2000 ms. It was 250 ms to 2 s. The "reconnecting…" chip was already a small tag in the header that never covers the camera.RETRY_MSinsrc/ui/video.jsdrops from 500 to 100 ms.src/ui/lobby-panel.test.tsnow expects the new delays.New test,
src/restart-session.test.ts:/liveand is still the driver with the sameendsAt./followframe then reaches the fake bus as a goal write with no extra step.node:httpneeds to avoid hanging.I ran the
src/uitests,lobby.test.ts,relay-restart.test.tsand the new test: all 208 pass.tsc --noEmitreports the same 32 errors as before my change, and none are in files I touched. I did not run the full suite ordesign-lint.Closes #440