-
Notifications
You must be signed in to change notification settings - Fork 731
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
Update Starscream, for real this time #1659
Conversation
|
||
/// Determines whether a SOCKS proxy is enabled on the underlying request. | ||
/// Mostly useful for debugging with tools like Charles Proxy. | ||
var enableSOCKSProxy: Bool { get set } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately v4 of Starscream doesn't support proxying at this time, so I had to remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super clean and straightforward. I'm not a web socket pro, but this seems easy enough. Would like to figure out whats up with that bug for sure, but I don't want to let it block us from moving forward here.
return | ||
} | ||
|
||
DispatchQueue.main.asyncAfter(deadline: .now() + reconnectionInterval) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it right to always be doing this on the main queue? Do we have to use main for some reason here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a reasonable question - this bit was basically moving around some existing code.
I suspect part of the reason it's on main
is because we do the initial connection on main
by default, but I suspect the bigger reason is because you can't just grab the current queue and dispatch on it the way you could in ObjC.
… getting due to a bug
76c7581
to
6cf7296
Compare
I've poked around a bit on the bug and gotten no response, so for now I'm going to disable the check for the disconnection notification so we can get this out the door. |
So I tried this in #1394 and messed it up something awful, so I took a step back and tried again. It's marginally less awful this time!
There's one place where a test on reconnection is failing because if you voluntarily call
disconnect
, it appears you never get any kind of callback that you've disconnected due to this issue with Starscream. I'm gonna see if anyone knows what's going on with that before giving up and updating the code in the tests that's waiting for the confirmation that the disconnection happened before trying to reconnect.