Skip to content

feature: hide blocked players in chat - #449

Merged
lukepolo merged 3 commits into
mainfrom
feature/chat-blocks
Sep 29, 2026
Merged

lukepolo merged 3 commits into
mainfrom
feature/chat-blocks

Conversation

@lukepolo

@lukepolo lukepolo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

The chat side of player blocking (#441): the blocker never sees the blocked player's chat, and DMs between the pair close both ways.

  • DMs are refused both ways with not_allowed; the conversation leaves the blocker's rail only
  • Group rooms: history, the draft-to-match re-send, live :chat/:edited and bell rows skip anyone who blocked the author, with one indexed query per fan-out
  • Blocking blanks the blocker's existing chat bell rows from the blocked player
  • A block landing mid-send still stops the DM (checked in the insert and in direct:incoming), and the bell catch-up blanks rows written after it
  • DM rooms only resolve under their canonical id; the join's close handler is registered before anything can fail; failed broadcasts are logged

Merge/deploy: stacked on #445, with #441 merged in. Merge last, after #441 and 5stackgg/web#626. Pairs with 5stackgg/web#628.

Not covered: in-game chat can't be filtered per player, and presence (:list, :joined, :left) still shows a blocked player.

Tests: a test fails without each fix: the DM mid-send race (SQL), the direct:incoming re-check, the bell catch-up after a late block, the non-canonical room id, the close-handler order, and (new tests) failed broadcasts being logged.

@lukepolo
lukepolo force-pushed the feature/chat-reactions branch from 4580a4e to 8754dee Compare September 29, 2026 00:52
Base automatically changed from feature/chat-reactions to main September 29, 2026 00:52
A DM between a blocked pair is refused both ways (an explicit
isBlockedEitherWay beside the friendship check) and leaves the blocker's
rail only. In group rooms the blocker never sees what the blocked player
says: join history and the draft-to-match resend are filtered per
recipient, :chat and :edited skip recipients who blocked the author, and
notifyLobbyMembers drops them. The block trigger blanks the blocker's
existing chat bell rows from the blocked player. One player_blocks query
per fan-out or history load.
…in cleanup

A block that commits between a send's check and its writes no longer gets
through: the DM insert itself refuses a blocked pair (and with it the
rail, delivery and bell), direct:incoming re-checks the recipient, and
the bell catch-up blanks rows aimed at a recipient who blocked the sender
meanwhile. A DM room is only reachable under its canonical id, the one
the block trigger and the rail filter match. The join's close handler is
registered before anything that can fail, and failed broadcasts are
logged rather than left unhandled.
A send, an edit or a draft's re-sent history whose broadcast rejects (the
block lookup it now runs, say) was a void promise with no handler.
@lukepolo
lukepolo merged commit 8c12880 into main Sep 29, 2026
1 of 2 checks passed
@lukepolo
lukepolo deleted the feature/chat-blocks branch September 29, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant