Repository navigation
feat(chat): wire contract — acked sends, 16k reject, server-minted identity - #205
Merged
Merged
Conversation
…entity Chat sends now use a Socket.io ack union (SendChatMessageAck): the server mints id/kind/sentAt, derives the room from the socket session, rejects empty and >16,000-char messages outright (never slices), and rate-limits by size — token cost = ceil(utf8 bytes of the whole serialized payload / 1000), clamped to bucket capacity so any legal message stays sendable, with a 64 KiB serialized backstop and maxHttpBufferSize at 128 KiB. The client gates the composer while a send is pending, times the ack out at 8s, keeps the draft on rejection, and only clears it when the ack matches the sent text. Includes a character counter past 14,000 and inline error surfacing. Covered by handler unit tests (malformed args, backstop, production guard wiring via call-through spy + behavioral bucket drain), rate-limit unit tests, ChatPanel tests, and a Playwright e2e for over-limit rejection, exact-16k delivery, and rate-limit rejection/recovery with an ordered non-delivery proof. Closes #192
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ntract # Conflicts: # client/src/components/ChatPanel.tsx
This branch was successfully deployed
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.
Summary
SendChatMessageAckunion withEMPTY_MESSAGE/MESSAGE_TOO_LONG/RATE_LIMITED/NOT_IN_ROOMrejection codes; server mintsid/kind/sentAtand derives the room from the socket session.max(1, ceil(utf8Bytes/1000))of the whole serialized payload, clamped to bucket capacity (documented — keeps every legal message sendable while draining the bucket), plus a 64 KiB serialized backstop andmaxHttpBufferSize: 128 KiB.Testing
Closes #192