graphql-ws: Subscriptions aren't re-submitted properly on reconnection after connection failures

Screenshot First websocket and its related subscriptions

image

Next valid connection with its related subscriptions:

image

As you can see, the second screenshot has much less subscriptions sent to the server.

Expected Behaviour

No subscriptions are lost while reconnecting to a server

Actual Behaviour

It managed to reconnect to the server properly but didn’t send the whole set of subscriptions

Debug Information

This seems to happen only when the websockets aren’t able to reconnect right away to a server. In my case: I restarted my server locally and because it’s using typescript and transpiling on the fly with babel, it takes a little while to restart properly. So to reproduce I just launched my client, my server and then restarted my server and waited.

I am joining a har file below that has content as well, you can open this in any Chromium browser (sadly Firefox doesn’t handle HAR with content yet) by dragging the file into your dev tools network panel.

It should load the whole story and you would be able to see my network at the moment of the bug happening.

websockets-operations-after-reconnection.har.zip

Further Information

As with the previous issue, please let me know if you need more information and/or help 🙏

Thank you again for your great work on this new library!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (15 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve managed to find some revelations in the meantime, bear with me - a fix is coming!

Wohoo! 🍾

Very nice news, thanks for sharing. 😄

I come bearing good news 😅

image

As you can see on the left it took some time for my server to restart (intended) and it seems all subscriptions were re-established properly.

So I’d say that rewrite brought some good stuff along!

Great stuff man, thanks so much for your help! 👏 I’ll keep an eye on this and will let you know in case I see something weird.

Hey @enisdenjo

Thanks for the update! I will take some time today to check that. Thank you so much for getting back to me on this, I am very sorry I didn’t have any moment to try and reproduce on a smaller repo. I haven’t forgotten though and will get back on it as soon as possible.

In the meantime I’ll try your update and will let you know!

You rock!