-
Notifications
You must be signed in to change notification settings - Fork 5
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
Proposal: guarantee message sent successfully if SendMessage() returns no error #6
Comments
As far as I know the backend isn't transactional, i.e. reception of an |
Isn't this how chat-gui handles it currently? Or how does it know whether the message was valid? If a public message was sent successfully we should (almost) immediately get the same message back on the ws feed. Same for private messages and Worst case if the error takes a few seconds to arrive sending messages is blocked for that duration. |
The way the chat server is currently designed, there's nothing that associates the error messages you get back with sent messages, so I don't think it would make sense for an api wrapper to provide that feature. |
chat-gui simply prints the "invalid message" as soon as it receives the |
Yeah, none of the dgg clients i've seen or wrote ever handle the errors like that. It's definitely doable but it's a little hacky since it goes against how the server API is written. |
Would It be feasible to add a handler that gets called every time anything is received on the websocket. So users can hack their own implementation of confirming a message was sent. |
if clients added a nonce to sent messages it could be echoed in the |
Right now errors are handled by the errorHandler, but it's not possible to determine for what message the error was and thus handling it is not really possible.
It is possible to determine if the message was sent successfully if we wait for the ws to respond with either an error or confirmation.
There would need to be a mutex for the ws that gets locked every time we send a message until confirmation is received to prevent getting errors or confirmation meant for a different message.
The text was updated successfully, but these errors were encountered: