-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-reconnect on refresh #2
Comments
The problem is it's not an actual reconnect. It's an attachment to the existing connection. It checks your JID, SID and RID. If i got everything right the SID is critical here. It has a small possible gap, like 1-5 for example. If you had a SID of 1 during the last request the server increases it by one and next time client must provide server with correct SID, in this case - 3. I store the SID every request. And maybe on page refresh it can get not exactly the last value. So the next attachment it's going to send the old incorrect SID and get rejected. I tried increasing the SID on attach event, but no success. That's why I put the popup there and didn't make it the default behaviour. I'll look into it later. |
Thank you for the quick response. I'll play around with the SID to see if I can get it to work. |
@jmm312 have you been able to resolve it? |
@lgalant Do you mean in the background on the mobile? |
@orangecoloured yes, I tweaked jabber to send messages as push notifications to the phone when the user is offline. When I click the notification it wakes the app up, but the user is offline. Thanks in advance for your help and awesome work on this app! |
@lgalant Well, the attach probably needs some debugging. It's in the XMPP docs, so I assume it should work. =) But the logging in again is definitely going to work. I'm not sure if it's the best practice to store the password somewhere on the frontend side. But I don't see any other way to quickly log in after a disconnect not using the BOSH attach. |
@orangecoloured I'm trying to modify the code to have it auto-reconnect to the server on browser refresh. I have modified index.js as shown in the image to remove the popup dialog. However, I am getting http://xx.xx.xx.xx/http-bind 404 (Invalid SID.) error. Any pointers?
The text was updated successfully, but these errors were encountered: