Websocket: should Tigase send a resource <conflict> stanza to the client before disconnecting the conflict-session

Matthew M
Added about 5 years ago

If the same user opens two websocket connection to tigase via web socket, and with the same resource, Tigase will disconnect the old one and let the new one connect. I think this is correct with XMPP. However, can tigase send a resource to the old connection before disconnecting it without any signaling? Something like this would be great for the client before disconnection.

<message xmlns="jabber:client">

We are trying to use web socket, and user might open (accidentally) another tab to connect, we would like to inform the user why the first tab is disconnected, and most of all, the javascript client in the disconnected one will not do re-connection (if it knows there the disconnection is due to resource conflict).

Right now, tigase disconnects the web socket without sending any reason, so the client does not know whether it should re-connect or not, as it might be a network hiccup.

Or maybe I missed something there? Thanks!

Replies (1)


Added by Artur Hefczyc TigaseTeam about 5 years ago

Tigase does send a conflict error to the client. It is a stream error:

There are a few problems with this error though:

  1. The error message is sent just before the TCP/IP connection is closed, so there is a chance that the error message is not delivered before connection closed, even though we make every effort on the server side to deliver the message

  2. The error message (stream error) is sent, delivered and received by the client but the client (library) does not handle it correctly, because it does not understand the conflict error.