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

Migrated from github.com/Trevato/SO-ARM100

A moderator's ban over /live is refused with 'that address is yours too' when the target shares the moderator's address, proven through the socket #350

Merged opened this

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

Merged

A moderator's ban over /live is now refused with "that address is yours too: the ban would bar you" when the target is on the moderator's own address. Nothing changes when it fires. I could not run bun x tsc --noEmit or bun install here: bun failed with "unable to write files to tempdir: ReadOnlyFileSystem".

Notes

shipped merged

opened this

A moderator's ban over /live is now refused with "that address is yours too: the ban would bar you" when the target is on the moderator's own address. Nothing changes when it fires. I could not run bun x tsc --noEmit or bun install here: bun failed with "unable to write files to tempdir: ReadOnlyFileSystem". The type check is unverified, and the forge's check will be the first to run it.

  • Guard: it is in banUser in src/lobby.ts. The target's address is the live seat's address, or the new Accounts.addressOf(id) when they are offline. It does not apply to the owner. I wrote addressOf fresh in src/accounts.ts because pull #334's version wasn't in this branch.
  • Test: a new test in src/lobby.test.ts has a moderator and a user on the same address. The moderator's ban gets the error, the admin log doesn't grow, and the user is not banned. A ban on a different address still works. I confirmed the test fails when the guard line is removed, and all 41 tests in that file pass with it back.
  • README: the moderators paragraph now says moderators can ban and unban, and mentions the refusal. forge.json is untouched.

Closes #344

Approved

Does what the issue asks: a moderator ban on a target sharing their address is refused with the exact wording, nothing is logged, other addresses still ban. The check sits in the shared lobby path, so the terminal door gets it too. The test goes through the socket and fails without the change; README updated. Address comes from the server-seen ip, not a client header. Next: (1) add a tty-side test for the same refusal; (2) when the address is unknown (addressOf null) the ban proceeds, so consider whether that should be refused for moderators too.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs