question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Private messages no longer received after websocket reconnect

See original GitHub issue

Test setup:

  • Latest Converse.js master
  • Firefox
  • A bot that sends a message to a MUC and a private chat every 5 seconds
  • The following config:
        websocket_url: "wss://xxx/ws",
        view_mode: "fullscreen",
        clear_messages_on_reconnection: true,

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:

 ERROR: Websocket closed unexpectedly converse-core.js:284:17
 2019-10-18T12:10:24.476Z INFO: Status changed to: DISCONNECTED converse-core.js:293:21
 2019-10-18T12:10:24.478Z INFO: RECONNECTING: the connection has dropped, attempting to reconnect. converse-core.js:293:21
 2019-10-18T12:10:24.504Z WARNING: Could not restore session for jid: Error message: The "restore" method can only be used with a BOSH connection. converse-core.js:286:17
 2019-10-18T12:10:24.504Z INFO: Status changed to: CONNECTING converse-core.js:293:21
 2019-10-18T12:10:25.120Z INFO: SASL authentication succeeded. converse-core.js:293:21
 2019-10-18T12:10:25.162Z INFO: Status changed to: undefined converse-core.js:293:21
 2019-10-18T12:10:25.285Z INFO: Status changed to: CONNECTED converse-core.js:293:21
 2019-10-18T12:10:25.287Z INFO: Reconnected 

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
jcbrandcommented, Nov 20, 2019

Fix released in version 5.0.5

0reactions
marclaportecommented, Nov 20, 2019

We saw an issue (using Openfire), which is probably this one. We will test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket messages are lost while client is reconnecting
This results in that some messages from the server are lost while the client is reconnecting. Is there any way to prevent this?...
Read more >
design patterns - buffering messages and send after reconnect
A solution seems to be sending a uuid from client side as message client side identifier and check it after receiving acknowledge from...
Read more >
WebSockets support in ASP.NET Core - Microsoft Learn
The server receives a disconnect message only if the client sends it, which can't be done if the internet connection is lost. If...
Read more >
25. WebSocket Support - Spring
The DISCONNECT may have been sent from the client, or it may also be automatically generated when the WebSocket session is closed. In...
Read more >
How to Implement SignalR Automatic Reconnect with Angular
SignalR does not reconnect automatically after a disconnection. ... Generally, WebSocket connections get disconnected automatically after a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found