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

Most upvoted comments

@enisdenjo I will try get it done this weekend.

Thanks for sharing, this is honestly too much of a setup to debug only graphql-sse. I’d really appreciate a repro.

Furthermore, can you share your Yoga setup? Are you using the @graphql-yoga/plugin-graphql-sse plugin with Yoga?

In the meantime, I’ll see whether I can get a similar failing test to #57 for single connection mode.

That is correct! I’ve tried to set up a simple repro repo but I fail to reproduce the issue.

Hey @2snEM6, I’ve just pushed v2.1.3 containing a fix for single connection mode - please give it a try!

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

GitHub’s still shaky, but I’ve pushed a new version nevertheless to unblock you guys. Try it out!

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