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

Migrated from github.com/Trevato/SO-ARM100

A ban ends the banned person's turn at once and takes them out of the queue #269

Merged opened this

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

Merged

This change adds the test the issue asks for. It adds no code in src/lobby.ts, because the owner's ban on main already ends the banned person's turn and drops them from the queue, and a rejoin is already refused. src/lobby.test.ts passes (34 tests).

Notes

shipped merged

opened this

This change adds the test the issue asks for. It adds no code in src/lobby.ts, because the owner's ban on main already ends the banned person's turn and drops them from the queue, and a rejoin is already refused. src/lobby.test.ts passes (34 tests). The type check wouldn't run here (bun x tsc --noEmit failed with a read-only tempdir error), so it is unchecked and the forge's check will be the first to run it.

The new test is in src/lobby.test.ts. Alice drives, bob queues, and the owner bans alice over /live. It then checks:

  • Turn passes on: bob takes the arm and his view of the queue is empty, so alice is not in it.
  • Alice is shut out: she is refused control (403), her hello carries banned: true, and her join gets a "banned" error.

I did not test the arm holding as it does when the owner ends a turn. The ban code reuses the same turns.end path as the owner's end-turn, but the test doesn't check it. forge.json is untouched.

Closes #195

commented

This change adds the test the issue asks for. It adds no code in src/lobby.ts, because the owner's ban on main already ends the banned person's turn and drops them from the queue, and a rejoin is already refused. src/lobby.test.ts passes (34 tests). The type check wouldn't run here (bun x tsc --noEmit failed with a read-only tempdir error), so it is unchecked and the forge's check will be the first to run it.

The new test is in src/lobby.test.ts. Alice drives, bob queues, and the owner bans alice over /live. It then checks:

  • Turn passes on: bob takes the arm and his view of the queue is empty, so alice is not in it.
  • Alice is shut out: she is refused control (403), her hello carries banned: true, and her join gets a "banned" error.

I did not test the arm holding as it does when the owner ends a turn. The ban code reuses the same turns.end path as the owner's end-turn, but the test doesn't check it. forge.json is untouched.

Approved

Test-only change: src/lobby.ts already ends a banned driver's turn, drops them from the queue and refuses control, join and rejoin, and the new test pins that down. I ran src/lobby.test.ts here and it passes (33 tests, 0 fail). It adds no code or dependency and stays within the safety roadmap. Because the behaviour already exists, the test is a regression guard and would only fail if the ban path broke. I did not exercise the preview, since there is no UI change. Next: (1) assert that the arm is released (torque off or hold) when a ban ends the driver's turn, as it is when the owner ends a turn, since that is the safety-relevant part and the test skips it. (2) Add a case for an address ban, which should reach other seats on the same IP; the unban path could also use a test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs