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

Propagate errors triggered on 'waiting' #1014

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pbartolome
Copy link

Goals ⚽

When Starscream uses the NWConnection from the Network framework (iOS 12+), some scenarios just fail silently without any type of feedback or callback back to the caller.

This is mainly due the fact that those errors are being returned when the connection state is waiting. According to Apple's documentation

Connections that are waiting will indicate the reason that the connection couldn't be established in the associated error. These errors are not fatal.

But this state is being reached on 'fatal errors' like connection rejected because SSL pinning failed or timeouts. In those cases, as the waiting state is reached, Starscream just ignores the returned error and the client will just wait as it won't receive any callback.

Implementation Details 🚧

To maintain compatibility with older implementations and to not modify existing behaviour a new WebSocketEvent has been added waiting(Error). This will contain the error propagated from the TCPTransport

@pbartolome
Copy link
Author

@acmacalister @daltoniam please take a look and let me known if there are changes needed to merge this PR so we can propagate and handle those errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant