Skip to content
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

Merged
merged 11 commits into from
Feb 19, 2021

Conversation

designatednerd
Copy link
Contributor

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.


/// 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 }
Copy link
Contributor Author

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.

Copy link
Contributor

@AnthonyMDev AnthonyMDev left a 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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@designatednerd
Copy link
Contributor Author

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.

@designatednerd designatednerd added this to the Next Release milestone Feb 19, 2021
@designatednerd designatednerd merged commit 8a8278f into main Feb 19, 2021
@designatednerd designatednerd deleted the update/no-seriously-starscream branch February 20, 2021 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants