-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Patch to fix iPod/iPad/iPhone browser from crashing when resuming on a sites using the websocket transport #426
Conversation
Patch to fix iPod/iPad/iPhone browser from crashing when resuming on a sites using the websocket transport
Thanks a lot! It's nitpicks time:
|
LOL, iOS does make more sense -- not sure where my brain was at.... I just didn't want people to think it was iPad or iPhone only so I went with iDevice. |
Hi I'm currently running iOS 6.02 and this fix does not resolve the crash issue for me. Any other ideas or more information on this would be great. Thanks |
@3rd-Eden do you know if this workaround is sufficient? |
@guille This is the correct fix for the issue as the setTimeout the WebSocket some extra time to set the correct readyState on the WebSocket. @rossholdway what are you running and iPad, iPod, iPhone and which generation of those. And what is the user agent string of your browser and browser version? |
@3rd-Eden I'm running this on the iPhone 5 within a Phonegap application (so basically within a UIWebView). My user agent string is
io.util.ua.iDevice looks to be returning true when running. |
hm.... did anybody report this bug to iOS devs? |
Is this reproducible without phonegap? Just so we can rule that out as offender. Sent from my iPhone On Jan 28, 2013, at 3:19 AM, Yaffle [email protected] wrote:
|
So I've been looking into this over the past few days and can confirm that running outside of Phonegap there is no crash caused on my device. Removing socket.io from my application does prevent the crashes, so I think the issue is likely connection related although maybe not directly caused by socket.io itself. I've submitted a bug report to Phonegap/Apache Cordova. Thanks, |
This will wrap the websocket.send in a setTimeout call only on idevices. The iDevice will crash because the browser hasn't detected that the socket has closed before the send is triggered. This will allow the browser to detect that the socket is invalid before attempting to send.