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

Migrated from github.com/Trevato/SO-ARM100

A chat mute can end on its own: Chat.muteUntil(id, name, until) in src/chat.ts, the old mute() unchanged #265

Closed opened this
Closed without merging

Chat.muteUntil(id, name, until) is in src/chat.ts with tests in src/chat.test.ts, and the branch is pushed. I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir". The 6 chat tests pass.

Notes

stopped closed without shipping deploy 1688e9b

opened this

Chat.muteUntil(id, name, until) is in src/chat.ts with tests in src/chat.test.ts, and the branch is pushed. I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir". The 6 chat tests pass.

The full bun test run shows 490 pass and 1 fail. The failure is in src/server.test.ts ("serves the model, its meshes and the vendored libraries…"), where a route returns 404 instead of 200. I didn't touch the server or the model routes, and I didn't check whether it also fails on main.

  • Timed mute: post refuses while now() < until and accepts afterwards. muteUntil throws a ChatError if until isn't a finite number.
  • Expiry: muted is now a getter that drops expired mutes (and saves) before returning the map. Callers still read chat.muted.has/get as before.
  • Old API: mute(id, name, on) keeps its signature and means for good. Calling it also clears any timed mute on that id.
  • Stored file: a timed mute is stored as {name, until}. A plain name string still loads as a permanent mute.
  • New tests:

- A timed mute blocks, survives a reload, then expires. - A permanent mute survives a reload. - An old-format file loads.

The timed-mute test uses a 10-minute mute and checks it at 599 s and 601 s rather than exactly 9:59 and 10:01.

Only chat.ts and chat.test.ts changed, and forge.json is untouched.

🤖 Generated with Claude Code

Closes #256

2 earlier comments · 1 event
commented

Chat.muteUntil(id, name, until) is in src/chat.ts with tests in src/chat.test.ts, and the branch is pushed. I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir". The 6 chat tests pass.

The full bun test run shows 490 pass and 1 fail. The failure is in src/server.test.ts ("serves the model, its meshes and the vendored libraries…"), where a route returns 404 instead of 200. I didn't touch the server or the model routes, and I didn't check whether it also fails on main.

  • Timed mute: post refuses while now() < until and accepts afterwards. muteUntil throws a ChatError if until isn't a finite number.
  • Expiry: muted is now a getter that drops expired mutes (and saves) before returning the map. Callers still read chat.muted.has/get as before.
  • Old API: mute(id, name, on) keeps its signature and means for good. Calling it also clears any timed mute on that id.
  • Stored file: a timed mute is stored as {name, until}. A plain name string still loads as a permanent mute.
  • New tests:

- A timed mute blocks, survives a reload, then expires. - A permanent mute survives a reload. - An old-format file loads.

The timed-mute test uses a 10-minute mute and checks it at 599 s and 601 s rather than exactly 9:59 and 10:01.

Only chat.ts and chat.test.ts changed, and forge.json is untouched.

🤖 Generated with Claude Code

commented

I merged main into the branch and pushed. The two conflicts in chat.ts and chat.test.ts were resolved by taking main's version, with muteUntil added on top.

main had already landed timed mutes with a different API. mute(id, name, until: number | null) takes a time, or null for good. There is also unmute, mutedList, and a muted getter that drops expired mutes. The file format is the same as mine. Keeping my version would have clashed with the callers already moved to that API, so I dropped it. This means the "old mute(id, name, on) unchanged" part of #256 no longer holds, because main changed that signature before this merge.

What this branch now adds is a small Chat.muteUntil(id, name, until) that calls mute. It throws a ChatError if until isn't a finite number. A test covers it: it blocks at 599 s, allows at 601 s, and rejects NaN.

I ran chat.test.ts and server.test.ts together: 60 pass, 1 fail. The failure is "serves the model, its meshes and the vendored libraries, and nothing outside them". It failed the same way before the merge, and this change doesn't touch those routes. I didn't run the type check here, because it failed earlier in this environment with a read-only temp directory.

Changes requested — before the latest push

The timed mute this pull was opened for is already on main (81fbc14, #253): mute(id, name, until: number | null), with expiry in prune() and takeExpired(). What is left here is muteUntil, a one-line wrapper over mute that nothing calls. That is dead API, and it gives main two ways to say the same thing. The only thing it adds is a finite-number check, and that check belongs in mute itself if it is wanted at all.

Fix first: drop muteUntil and its test, and close the pull as already done on main. If the NaN guard matters, put it in mute() where the real callers go through it, with a test on that. The author also said the type check was not run and that one server.test.ts test fails; both should be cleared before anything lands.

No page or tty surface changes, so there is nothing to check in the preview.

commented

Declined: already done on main in 81fbc14. I agree with the review: muteUntil was a one-line wrapper over mute(id, name, until) that nothing calls, so I removed it and its test. Run log: https://forge.open-platform.sh/trevato/arm/runs/01m5e70djt00c3xwdene4v309w

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs