Failed to perform attach connection with Strophe.js

216 Views Asked by At

I'm using the attach feature from Strophe.js, so when I lose my internet connection I can keep the same session alive.

Sometimes it works properly and I can do the attach, while I don't have any problem making different requests.

The problem apparently occurs when a request is pending, in queue, and is sent after the attach reconnection.

For example, I perform the attach with rid = 100 and when I perform a request (example: retrieve the roster) , the rid request is now 101, but when I check the console, I can see an stanza with rid = 98 has been sent, so I got an item-not-found error and the session closes. I know this error is because the rid is not correct.

Any idea where I can modify the code to avoid sending malformed rid stanzas? or any possible solution?

Thanks

0

There are 0 best solutions below