RocketChat / Rocket.Chat.js.SDK

Utility for apps and bots to interact with Rocket.Chat via DDP and/or API
MIT License
135 stars 95 forks source link

Socket keeps closing on ios release build #68

Open uncledent opened 5 years ago

uncledent commented 5 years ago

On release build on iOS the socket stays active for like 45 seconds and then gets closed with 1001 error (reason: Stream end encountered). On Debug build everything is fine, connections stays open. Interestingly ping/pong does not stop....

Any idea? I spent a whole day on this and can't find out any reason for this....

Any help will be appreciated.

uncledent commented 5 years ago

So I found out, that this is an implementation problem. Pings are lost. Probably my PR has a fault on this. I will fix it and update the Pull Request.

aswanyaugustine commented 5 years ago

any update on this? socket connection to my meteor app(rocket chat) keep on getting lost /close after a particular time since from it found no change events (no new message) on listening event (streaming on message subscription)

uncledent commented 5 years ago

@iconist for me the problem was that the sdk.connect call was called twice with 20ms difference, which caused a double initialization of Socket. So it pinged a wrong one.