Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an API route for sending chat messages. #512

Draft
wants to merge 14 commits into
base: default
Choose a base branch
from
Draft

Conversation

goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Apr 22, 2022

We are currently using the WebSocket connection for receiving and sending chat messages. Sending messages has a small client bug when the message the server broadcasts is different from the one you sent (eg. your message was truncated). The client tries to infer which message has just completed sending by comparing the message text. Truncated messages will then always show as if they're still sending.

Instead of building some RPC system on the WebSocket, we can use HTTP requests and respond with the generated message ID, so the client can reliably find the message that was sent.

(Need to test this with the client a bit, I think we may need to support a client-generated ID instead.)

Closes #57

@coveralls
Copy link

coveralls commented Apr 22, 2022

Coverage Status

Coverage increased (+0.4%) to 78.386% when pulling a7b4537 on http-chat into 9d54904 on default.

@goto-bus-stop goto-bus-stop marked this pull request as ready for review April 30, 2022 10:26
@goto-bus-stop
Copy link
Member Author

This will also need to first guarantee that the user is actually connected…

@goto-bus-stop goto-bus-stop marked this pull request as draft October 1, 2022 11:10
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.

chat: "tagged" messages
2 participants