JSJaC icon indicating copy to clipboard operation
JSJaC copied to clipboard

ondisconnect not being triggered

Open SET001 opened this issue 11 years ago • 1 comments

There are some cases when ondisconnect event is not being triggered. If we have some logged in user and then another user will log in using same credentials, then on first user side 2 event will be triggered: onStatusChanged with session-terminate-conflict and onerror with error code of 503. But even if in both cases I would call JSJaCWebSocketConnection.disconnect() - it still would to trigger ondisconnect event so there are no one point where I can definitely say that it was disconnected.

SET001 avatar May 07 '14 23:05 SET001

At the time onStatusChanged triggered xmpp.connected() return true but later, in onerror, it is already disconnected. So I suppose ondisconnect should be triggered between them. For the moment I fixed it with calling xmpp.disconnect() manually in onStatusChanged but still suppose such a behavior is a bug.

SET001 avatar May 07 '14 23:05 SET001