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

[Android] Check that WS connection is open before closing it on failed. Fixes #3346 #3347

Closed
wants to merge 1 commit into from

Conversation

yzarubin
Copy link
Contributor

Check that the WS state is set to OPEN before trying to close it when the websocketFailed event fires. Otherwise the app throws an error at the Android level.

Fixes #3346

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 11, 2015
@satya164
Copy link
Contributor

@mkonicek Can we merge this? Sorry for the issue, I didn't test properly after the review.

@mkonicek
Copy link
Contributor

@facebook-github-bot shipit

Thanks for the fix @yzarubin!

@ide
Copy link
Contributor

ide commented Oct 12, 2015

Should this check go in _closeWebSocket? Opened #3364 so we look into this later after cutting 0.13 with the fix in this PR.

@yzarubin
Copy link
Contributor Author

@satya164 Thanks for the Android WS implementation!
@mkonicek Np! For some reason the FB bot never added the GH Review label to this PR, will the shipit still work?
@ide I considered adding the check to _closeWebSocket, but decided against it for now and just fixed the bug instead. We should probably first figure out which layer should ultimately own the WS state and be responsible for throwing errors.

@mkonicek
Copy link
Contributor

@ide, @yzarubin It might be easier to maintain the state in native but don't think iOS does that so we're good for now. It would be amazing if someone could add a cross-platform example to the iOS and Android UI Explorer so we can at least play with the implementation and see it works :)

I'll request rigorous test plans and examples on complex PRs in the future.

@mkonicek
Copy link
Contributor

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/1654193344827885/int_phab to review.

@ghost ghost closed this in 45644aa Oct 14, 2015
ide pushed a commit to expo/react-native that referenced this pull request Oct 23, 2015
…acebook#3346

Summary: Check that the WS state is set to OPEN before trying to close it when the ```websocketFailed``` event fires. Otherwise the app throws an error at the Android level.

Fixes facebook#3346
Closes facebook#3347

Reviewed By: @​svcscm

Differential Revision: D2535807

Pulled By: @mkonicek

fb-gh-sync-id: bb70c551ea2e582cfaa80139a265dbbca6d990d2
MattFoley pushed a commit to skillz/react-native that referenced this pull request Nov 9, 2015
…acebook#3346

Summary: Check that the WS state is set to OPEN before trying to close it when the ```websocketFailed``` event fires. Otherwise the app throws an error at the Android level.

Fixes facebook#3346
Closes facebook#3347

Reviewed By: @​svcscm

Differential Revision: D2535807

Pulled By: @mkonicek

fb-gh-sync-id: bb70c551ea2e582cfaa80139a265dbbca6d990d2
Crash-- pushed a commit to Crash--/react-native that referenced this pull request Dec 24, 2015
…acebook#3346

Summary: Check that the WS state is set to OPEN before trying to close it when the ```websocketFailed``` event fires. Otherwise the app throws an error at the Android level.

Fixes facebook#3346
Closes facebook#3347

Reviewed By: @​svcscm

Differential Revision: D2535807

Pulled By: @mkonicek

fb-gh-sync-id: bb70c551ea2e582cfaa80139a265dbbca6d990d2
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebSocket module for Android crashes app when it fails to connect
5 participants