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

Reconnection not working on Chrome #27

Closed
Emilios1995 opened this issue Jun 8, 2022 · 4 comments
Closed

Reconnection not working on Chrome #27

Emilios1995 opened this issue Jun 8, 2022 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers released Has been released and published

Comments

@Emilios1995
Copy link

Emilios1995 commented Jun 8, 2022

Screenshot
Screen Shot 2022-06-08 at 18 22 17

Expected Behaviour
Disconnecting the client from the internet and the reconnecting should cause it to reconnect when graphql-sse performs a re-connection attempt.

I'm using a mostly standard setup of the graphql-sse client with Relay.

Actual Behaviour
I see an error ending up in the console as in the screenshot. It's not being handled by graphql-sse and reconnecting. The error ends up at the top of my sink.

Firefox and Edge actually work for me. The problem is in Chrome and Safari.

Debug Information
I discovered that the error surfaces in this catch clause in the form of a TypeError with the message: network error (which is standard with the Fetch API AFAIK) but since it was never converted to a NetworkError, it doesn't trigger a retry.

I dug deeper to find the source of the error and see why it wasn't converted to NetworkError and noticed that it was thrown from the toAsyncIterator function, from which apparently you didn't anticipate network errors occurring.

Further Information

  • I tried disabling the QUIQ protocol via a Chrome flag and the console error changes to ERR_NETWORK_CHANGED

Pleas let me know if you aren't able to reproduce and whether I can help with anything.

@enisdenjo
Copy link
Owner

Great catch! I've noticed it also with #22 (comment) but you beat me to creating an issue.

Thanks for reporting! I'll take care of it soon. 👍

@enisdenjo enisdenjo added bug Something isn't working good first issue Good for newcomers labels Jun 9, 2022
enisdenjo pushed a commit that referenced this issue Jun 9, 2022
## [1.2.1](v1.2.0...v1.2.1) (2022-06-09)

### Bug Fixes

* **client:** Retry network errors even if they occur during event emission ([489b1b0](489b1b0)), closes [#27](#27)

### Performance Improvements

* **client:** Avoid recreating result variables when reading the response stream ([16f6a6c](16f6a6c))
@enisdenjo
Copy link
Owner

🎉 This issue has been resolved in version 1.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@enisdenjo enisdenjo added the released Has been released and published label Jun 9, 2022
@enisdenjo
Copy link
Owner

enisdenjo commented Jun 9, 2022

Seems like this issue is still present in Safari and Firefox.

@enisdenjo
Copy link
Owner

enisdenjo commented Jun 9, 2022

Firefox is now handled with 054f16b and released in v1.2.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers released Has been released and published
Projects
None yet
Development

No branches or pull requests

2 participants