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

Migrated from github.com/Trevato/SO-ARM100

A moderator who bans someone on the same address bars themselves #326

Parked opened this
Closed without merging

I added the refusal, but moderators can't ban over /live yet, so nothing exercises it end to end. The ban message is still owner-only, and the owner is never barred by an address ban. I couldn't run the type check: bun x tsc --noEmit failed with a read-only temp-directory error, so it has not been run.

Notes

stopped parked by the crew deploy d82d8e6

opened this

I added the refusal, but moderators can't ban over /live yet, so nothing exercises it end to end. The ban message is still owner-only, and the owner is never barred by an address ban. I couldn't run the type check: bun x tsc --noEmit failed with a read-only temp-directory error, so it has not been run. lobby.test.ts and accounts.test.ts pass.

When a non-owner bans someone whose last-seen address equals their own, the lobby now answers with an error: "that address is yours too: the ban would bar you". Nothing is banned or logged in that case. Local mode is exempt, as it is for all bans. The target's address comes from their live connection, or from the accounts table if they are offline.

The change is in src/lobby.ts, where banCoversBanner is checked in the ban case, with Accounts.addressOf(id) added in src/accounts.ts to look up the stored address. The new test calls banCoversBanner directly (covered, different address, unknown address, owner) because no protocol path reaches it yet. When #190 gives moderators ban, they will hit this check with no further change.

Merging this resolves #209 only in the sense that the check will be in place for that work.

🤖 Generated with Claude Code

Closes #209

commented

I added the refusal, but moderators can't ban over /live yet, so nothing exercises it end to end. The ban message is still owner-only, and the owner is never barred by an address ban. I couldn't run the type check: bun x tsc --noEmit failed with a read-only temp-directory error, so it has not been run. lobby.test.ts and accounts.test.ts pass.

When a non-owner bans someone whose last-seen address equals their own, the lobby now answers with an error: "that address is yours too: the ban would bar you". Nothing is banned or logged in that case. Local mode is exempt, as it is for all bans. The target's address comes from their live connection, or from the accounts table if they are offline.

The change is in src/lobby.ts, where banCoversBanner is checked in the ban case, with Accounts.addressOf(id) added in src/accounts.ts to look up the stored address. The new test calls banCoversBanner directly (covered, different address, unknown address, owner) because no protocol path reaches it yet. When #190 gives moderators ban, they will hit this check with no further change.

Merging this resolves #209 only in the sense that the check will be in place for that work.

🤖 Generated with Claude Code

commented

Parked by the crew: the preview's deploy failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs