feature: chat moderation — gag blocks website chat, moderator message deletion - #438
Merged
Merged
Conversation
This was referenced Sep 28, 2026
… messages
A gag (or silence) now also refuses website sends in every group room with
chat:error { code: "gagged" }; DMs and lines relayed from the game are left
alone. Moderators and up can delete any message in a group room they can
access via lobby:delete; the message is audited to chat_message_deletions
before it is removed from redis, the room gets lobby:<type>:<id>:deleted,
and its unread bell rows / pending pushes are retracted.
…at:error
- retract a deleted message's notifications by message id alone (new
partial index), so a draft lobby's lines that moved into the match room
are still retracted; the retracted text is blanked, since a recipient can
read and restore their own deleted rows
- re-check after writing a message's notifications: a delete that landed
while they were being written had nothing to retract yet
- organizers-room audit rows stay hidden from moderators (the room is
match_organizer and up)
- chat:ack and chat:error now carry action ("send" | "delete") so the web can
tell a failed delete from a failed send
The redis field is also gone when a message expires (a 0 TTL drops it at once) or when a draft lobby's history moves into the match, and treating either as a delete retracted every notification for a message nobody removed. The audit row is committed before a delete retracts, so it answers the same race without the false positives. The unique key leads with message_id so that lookup is indexed. Retraction is also scoped to the chat notification types.
The post-write re-check once read a missing redis field as a delete, which also retracts the rows of a message that merely expired or moved with its draft lobby. The retraction is scoped to the chat notification types.
lukepolo
force-pushed
the
feature/chat-moderation
branch
from
September 29, 2026 00:49
60d2f76 to
af7a1ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A gag now also blocks website chat, and moderators can delete chat messages with a private audit trail.
gagorsilencerefuses website sends in every group room withgagged; DMs and lines from the game are untouchedlobby:deletechat_message_deletionsrow before the message leaves redis; moderators can't read the organizers room's rowslobby:delete {type, id, messageId, requestId?}in,lobby:<type>:<id>:deleted {id}out; acks and errors now carryactionMerge/deploy: stacked on #435; run
yarn hasura:metadataafter merge. Pairs with 5stackgg/web#618.Tests: a test fails without each fix: gag on web sends, audit before removal, role on record, numeric steam id stored as no author, retraction by id after a draft move, blanked text, collapsed rows staying retired, and (new tests) the post-write re-check by audit row, so an expired message's rows are no longer retracted, plus chat-type scoping. Manual QA: as a moderator, query
chat_message_deletionsand confirmorganizersrows are hidden. Based on DEAFCS 5be040c91