/kick and /ban failures are silent (rateLimitedActions swallows non-429 errors) #216

Closed
opened 2026-09-18 19:27:25 -04:00 by jared · 1 comment
Owner

Verified under #187 DP1: /join #does-not-exist:localhost shows "Command failed: The /join command failed. Please try again." but /kick @nobody:localhost in a room where you cannot kick clears the composer and shows nothing. The code already documents why (useCommands.ts:295-298): rateLimitedActions' to() helper swallows every non-429 error, so the exe() catch in RoomInput never fires. Same for /ban.

Fix: have rateLimitedActions collect per-item failures and rethrow (or return) them after the loop so the command layer can toast "Could not kick @x: you don't have permission" — the error text is in the MatrixError already.

Verified under #187 DP1: `/join #does-not-exist:localhost` shows "Command failed: The /join command failed. Please try again." but `/kick @nobody:localhost` in a room where you cannot kick clears the composer and shows **nothing**. The code already documents why (`useCommands.ts:295-298`): `rateLimitedActions`' `to()` helper swallows every non-429 error, so the `exe()` catch in `RoomInput` never fires. Same for `/ban`. Fix: have `rateLimitedActions` collect per-item failures and rethrow (or return) them after the loop so the command layer can toast "Could not kick @x: you don't have permission" — the error text is in the MatrixError already.
jared added the bugpriority: lowuxarea: messaging labels 2026-09-18 19:27:25 -04:00
Author
Owner

Fixed in 60076a48. rateLimitedActions now returns { failures } (non-429 errors, plus a 429 that exhausted its retries) instead of swallowing them; existing callers ignore the return. /kick and /ban turn the list into a CommandError whose message names who and why, using the server's own sentence (MatrixError.data.error) — never the URL-bearing toString() — and the RoomInput toast shows it verbatim.

Verified headless as a non-moderator in Busy Room:

  • /kick @alice:localhost → toast "Could not kick @alice:localhost: You cannot kick user @alice:localhost."
  • /ban @nobody:localhost @alice:localhost"Could not ban @nobody:localhost, @alice:localhost: You don't have permission to ban"

(Side note for testers: as upstream, a command only counts when picked from the autocomplete — typing /kick … and pressing Enter without the chip sends it as plain text.)

Fixed in `60076a48`. `rateLimitedActions` now returns `{ failures }` (non-429 errors, plus a 429 that exhausted its retries) instead of swallowing them; existing callers ignore the return. `/kick` and `/ban` turn the list into a `CommandError` whose message names who and why, using the server's own sentence (`MatrixError.data.error`) — never the URL-bearing `toString()` — and the RoomInput toast shows it verbatim. Verified headless as a non-moderator in Busy Room: - `/kick @alice:localhost` → toast **"Could not kick @alice:localhost: You cannot kick user @alice:localhost."** - `/ban @nobody:localhost @alice:localhost` → **"Could not ban @nobody:localhost, @alice:localhost: You don't have permission to ban"** (Side note for testers: as upstream, a command only counts when picked from the autocomplete — typing `/kick …` and pressing Enter without the chip sends it as plain text.)
jared closed this issue 2026-09-19 12:40:57 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#216