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

Migrated from github.com/Trevato/SO-ARM100

A chat mute can last 10 min, 1 h, 24 h or for good, and ends on its own - in src/chat.ts (after #211 makes main's tests green) #222

Parked opened this
Closed without merging

A chat mute can now end on its own, but I didn't get a full green bun test here. Everything passed except one src/server.test.ts test (the vendored three.js route, /vendor/three/build/three.module.js). That route returned 404 in my sandbox.

Notes

stopped parked by the crew deploy 5270be6

opened this

A chat mute can now end on its own, but I didn't get a full green bun test here. Everything passed except one src/server.test.ts test (the vendored three.js route, /vendor/three/build/three.module.js). That route returned 404 in my sandbox. I don't think my change touches it, but I haven't confirmed that.

  • Chat.mute: it is now mute(id, name, until: number | null), where null means for good. post refuses while now < until and accepts afterwards.
  • Expiry: muted is now a getter that drops expired mutes each time it is read.
  • Storage: the file keeps {name, until} per person, and the old format (a plain name string) still loads as a permanent mute.
  • unmute: I added Chat.unmute(id) because mute no longer has an on/off flag.
  • Caller: the lobby's mute handler in src/lobby.ts passes null, so mutes stay permanent by default.
  • Tests: the new tests in src/chat.test.ts use an injected clock. A 10-minute mute blocks at 9:59 and allows at 10:01. A permanent mute survives a reload, and an old-format file loads.

Nothing sets a timed mute yet; the 10 min / 1 h / 24 h choices need a caller that passes a real until.

I didn't run bun x tsc --noEmit. Bun failed with "unable to write files to tempdir", so the type check hasn't been done.

🤖 Generated with Claude Code

Closes #213

commented

A chat mute can now end on its own, but I didn't get a full green bun test here. Everything passed except one src/server.test.ts test (the vendored three.js route, /vendor/three/build/three.module.js). That route returned 404 in my sandbox. I don't think my change touches it, but I haven't confirmed that.

  • Chat.mute: it is now mute(id, name, until: number | null), where null means for good. post refuses while now < until and accepts afterwards.
  • Expiry: muted is now a getter that drops expired mutes each time it is read.
  • Storage: the file keeps {name, until} per person, and the old format (a plain name string) still loads as a permanent mute.
  • unmute: I added Chat.unmute(id) because mute no longer has an on/off flag.
  • Caller: the lobby's mute handler in src/lobby.ts passes null, so mutes stay permanent by default.
  • Tests: the new tests in src/chat.test.ts use an injected clock. A 10-minute mute blocks at 9:59 and allows at 10:01. A permanent mute survives a reload, and an old-format file loads.

Nothing sets a timed mute yet; the 10 min / 1 h / 24 h choices need a caller that passes a real until.

I didn't run bun x tsc --noEmit. Bun failed with "unable to write files to tempdir", so the type check hasn't been done.

🤖 Generated with Claude Code

commented

Parked by the crew: the preview's deploy failed in the place it ran, not in the change, and it could not be run again

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs