converse.js icon indicating copy to clipboard operation
converse.js copied to clipboard

Disconnect of left-over connection triggers log-out

Open Zash opened this issue 4 years ago • 0 comments

Describe the bug Converse.js treats the disconnect of an earlier connection attempt as a disconnect of the current session.

To Reproduce Steps to reproduce the behavior:

  1. Try to log in, but type the wrong password
  2. Login again but with the correct password
  3. Wait 5 minutes
  4. Converse.js gets disconnected out of the blue

Expected behavior Shouldn't get disconnected

Environment (please complete the following information):

  • Converse.js version e896361b2
  • Prosody trunk
  • Websockets used

Additional context What happens is that the first, failed, login attempt creates a new connection. Then, after Prosodys c2s_timeout, because this connection hasn't authenticated successfully yet, it gets disconnected. However Converse.js created another connection during the second login attempt, and this connection carries on being fine since it's logged in.

Browser console says

ERROR: WebSocket stream error: connection-timeout
DEBUG: Status changed to: ERROR log.js:70:19
DEBUG: _doDisconnect was called log.js:70:19
DEBUG: WebSockets _doDisconnect was called log.js:70:19
DEBUG: Status changed to: DISCONNECTED log.js:70:19
DEBUG: DISCONNECTED log.js:70:19

Zash avatar Mar 23 '21 12:03 Zash