graphql-sse: Infinite retries
Expected Behaviour The client should only retry up to the specified retry number.
Actual Behaviour
The client retries to infinite and beyond with the error Connection closed while having active streams
.
Debug Information I´m only able to reproduce this problem on my application that I can´t share but the issue lays here https://github.com/enisdenjo/graphql-sse/blob/master/src/client.ts#L476
Before getting the results we clear the number of retries but if the client fails to get the results back (which is the problem in my case) it will keep retrying over and over.
I think the number of the retries should only be cleared after successfully getting the results back.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 24 (11 by maintainers)
Commits related to this issue
- fix(client): Respect retry attempts when server goes away after connecting (#57) Closes #55 — committed to enisdenjo/graphql-sse by enisdenjo a year ago
- chore(release): 🎉 2.1.2 [skip ci] ## [2.1.2](https://github.com/enisdenjo/graphql-sse/compare/v2.1.1...v2.1.2) (2023-05-10) ### Bug Fixes * **client:** Respect retry attempts when server goes away... — committed to enisdenjo/graphql-sse by semantic-release-bot a year ago
- fix(client): Respect retry attempts when server goes away after connecting in single connection mode (#59) Closes #55 — committed to enisdenjo/graphql-sse by enisdenjo a year ago
- chore(release): 🎉 2.1.3 [skip ci] ## [2.1.3](https://github.com/enisdenjo/graphql-sse/compare/v2.1.2...v2.1.3) (2023-05-15) ### Bug Fixes * **client:** Respect retry attempts when server goes away... — committed to enisdenjo/graphql-sse by semantic-release-bot a year ago
@enisdenjo I will try get it done this weekend.
That is correct! I’ve tried to set up a simple repro repo but I fail to reproduce the issue.
Thank you very much! I will give it a try and let you know 🙏🙏
Yes, on 2.1.2. I will try to create a small server to reproduce it, but it’s hard. I saw that if the NodeJS subscriptions server crashes abruptly, I get a 404 error on the frontend, meaning the stream cannot be found. I will share more information when I have it available
It works great! Thanks!!
Thanks @enisdenjo , timing couldn’t be better. If you need any help testing this, I am happy to help. Thank you!
I was able to pinpoint the problem in my server.
I will try and create a small poc