feat(chat): optimistic echo and moderation delivery notices - #19
Open
ChronoFinale wants to merge 1 commit into
Open
feat(chat): optimistic echo and moderation delivery notices#19ChronoFinale wants to merge 1 commit into
ChronoFinale wants to merge 1 commit into
Conversation
Your message appears the moment you press enter rather than after the round
trip. If it was refused, a notice below quotes the message it refers to and
gives the server's reason - the quote matters because several sends can be in
flight, which is exactly what rate limiting produces. If moderation rewrote
it, a notice says what other players actually received, so a rewrite is never
silent.
The api client stops treating every non-2xx as player-facing copy: only a
decoded { error } body is a real reason. A proxy error page or a bare status
is a transport failure now, so raw server text cannot reach the chat overlay.
It also passes the response body through, since a rewrite returns publishText.
Needs the relay's moderation bridge to be configured to do anything: without
it the server never returns those reasons and the echo is all that changes.
ChronoFinale
force-pushed
the
feat/chat-moderation-ux
branch
from
August 7, 2026 00:20
8d65754 to
f8c50b8
Compare
ChronoFinale
marked this pull request as ready for review
August 7, 2026 02:10
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.
Client half of moderated chat. 78 lines, four files.
Optional. Without it chat still works and a refused message still shows the server's reason — you just lose the instant echo and the "what everyone else saw" notice. Server half: Balatro-Multiplayer/BalatroMultiplayerAPI-Server#44.
What a player sees
Your message appears the moment you press enter instead of after the round trip.
If it was refused, a notice below quotes the message it refers to and gives the server's reason:
The quote matters — several sends can be in flight (fast typing, or a burst against the route's rate limiter), and an unattributed "not sent" tells you nothing about which one it refers to.
If moderation rewrote the message, a notice says what other players actually received, so a rewrite is never silent.
The api-client change
send_chat_messagestops treating every non-2xx as player-facing copy. Only a decoded{ error }body is a real reason; a proxy error page or a bare status isTRANSPORTnow, so raw server text can't reach the chat overlay. It also passes the response body through, since a rewrite returnspublishText.Notes
localize(), following the existing[MultiplayerAPI]prefix convention.main, so it includes the/sayconsole behaviour and the report/mute work rather than conflicting with it.