-
-
Notifications
You must be signed in to change notification settings - Fork 781
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
Private messages no longer received after websocket reconnect #1760
Comments
FYI, setting |
I'm unsure if this makes any difference, but to be clear: When you say 'private message', do you mean a direct one-on-one message, or a 'private message' as defined in https://xmpp.org/extensions/xep-0045.html#privatemessage ? |
Right, I just meant a regular one-on-one message. |
I found an easier way to reproduce the disconnect/reconnect: Using this method, the connection to my server (ejabberd) behaves the same way as initially described in this ticket: it'll succesfully reconnect, but after that one-to-one messages are silently discarded. @guusdk kindly provided an Openfire environment for me to test on. There, I can't reproduce this exact issue because Converse doesn't even succesfully recover from a websocket disconnection:
... after which an empty window with spinner appears indefinitely. Almost every fatal Converse bug I encountered this year was triggered by a connection disconnect/reconnect, be it BOSH or websocket. Note that also without doing server restarts or I would urge everyone working on either BOSH or websocket (re)connection methods in Converse to employ this Any suggestions on adding automated testcases for situations like this are welcome too. |
Seems related to #1727 but I'm on ejabberd. |
Unsure if this is related: After the connection hiccup, Openfire starts logging messages that suggest that the client is sending data, before it is authenticated. I'm noticing this message in the logs that @laszlovl provided:
Openfire doesn't generate that, so I'm assuming that it is Converse that logs this. The issue might be explained by a scenario where 'restore' does not working, but Converse nonetheless continues as if the restore was successful. |
The difference is that converse-muc has: async onReconnection () {
// ... some lines removed ...
this.registerHandlers();
}, while converse-chat has no onReconnection () {
if (_converse.clear_messages_on_reconnection) {
this.clearMessages();
}
this.announceReconnection();
}, but only: _converse.api.listen.on('presencesInitialized', (reconnecting) => (!reconnecting && registerMessageHandlers())); Adding some loglines and triggering the reconnect shows that indeed converse-muc's But as I mentioned in the chat a couple of times, this is as far as I can get. I don't understand why converse-muc and converse-chat have different ways of handling their handlers, so I don't know how to fix it properly and need some help here. I really hate to be that guy that criticizes an overworked and underpaid open source maintainer, but if a bug like this is ignored for a month I don't know if this project has any future. This issue affects a dozen of Converse instances out there, since websocket connections are preferred over bosh connections and the bug is present since at least v5.0. Just go to any public XMPP/Converse instance such as https://web.404.city/ and login, trigger a reconnect (with tcpkill, or just close & reopen your laptop, or whatever) then observe any private messages sent to it are silently discarded. There are probably hundreds or thousands of users currently suffering from this issue and missing messages, often without even realising it. For a chat client, it's absolutely paramount that the chat messages you send & receive actually fscking arrive. Infinitely more important than emojis, foreign language support or whatever other gimmick. I am very happy to contribute time and resources towards this goal, but if I can't get the rest here to share that vision I'm just wasting my time. |
@laszlovl: Thanks for doing some more research, I think you've identified the problem, which is that the message handlers for private chats are explicitly not re-registered upon reconnection. Looks like this bug was introduced in commit 7200967, and then taken forward during refactoring. I believe you could have fixed this bug yourself if you used |
@jcbrand Thanks for looking into this! I can confirm that it fixes the problem in my quick initial testing. I did this research a month ago and discussed it on the chat, but I repeatedly couldn't find you (or anyone else) willing to assist me further. I get that it's impossible to dedicate hours of your time to everybody and their favorite issue/feature request, but if one is not able to get some help in investigating complicated (and severe!) issues like these, it'll be pretty damn hard to get anyone other than you involved in development. Again, I laud all your work and really don't mean for this to be a personal attack; just trying to convey my point of view and ultimately improve the state of Converse. :) |
We saw an issue (using Openfire), which is probably this one. We will test. |
Fix released in version 5.0.5 |
Test setup:
Everything functions fine at first. Then on the websocket server, I issue a
service nginx restart
to force the websocket connection to restart. This generates log messages:After this, the bot's messages are still received in the MUC but no longer in the private conversation.
The same problem does not occur when using BOSH instead of websockets.
The text was updated successfully, but these errors were encountered: