You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that, when attaching to a session, if there is no activity (send stanza) Strophe never polls.. and the session expires after a while whereas I'm attached..
When using #connect, Strophe polls at least every 60 seconds. When attached, should we not have the same behavior ?
I don't know if this should be fixed but I think I have the fix, which is not hard. Actually, the _onIdle process is not triggered because we are disconnected, it shall be restarted by hand : In #attach(), #_onIdle() shall be called at the end.
I had to place _onIdle() before this._changeConnectStatus because my attach() callback is being triggered there. If I place it at the end like you propose first stanza from my callback receives no response because there is no polling. Are we doing something wrong or is this an issue?
I've had the same problem. It seems it that attach() should call flush() before _changeConnectStatus(). This triggers the call to _onIdle(), and doesn't stomp on any existing timeouts configured. A workaround for it is to call flush() in the callback you pass to attach():
connection=newStrophe.Connection(host);onAttach=function(status){connection.flush();// do whatever else you need to do when connecting};connection.attach(jid,rid,sid,onAttach);
I noticed that, when attaching to a session, if there is no activity (send stanza) Strophe never polls.. and the session expires after a while whereas I'm attached..
When using
#connect
, Strophe polls at least every 60 seconds. When attached, should we not have the same behavior ?I don't know if this should be fixed but I think I have the fix, which is not hard. Actually, the
_onIdle
process is not triggered because we are disconnected, it shall be restarted by hand : In#attach()
,#_onIdle()
shall be called at the end.I'll do a pull request if you find this relevant. Thanks.
The text was updated successfully, but these errors were encountered: