ReactJS Apollo Client Subscription stops working after 24 hours or when users change tabs

I am using createSubscriptionHandshakeLink and subscriptions simply stop working after 24 hours even though the user is till authenticated (token lasts a really long time)

Hey @Moi :wave:

Unfortunately Apollo doesn’t maintain that link, so the best bet would be to open an issue over in the AWS AppSync repo (I’m pretty sure this is where that link comes from). Apollo core just forwards the operations to the links themselves, but its up to the links to handle how to connect/terminate the connection for any given operation. You might find something useful in that repo that helps here.

I should also mention, there might be a possibility you can get this to automatically retry with either the built-in RetryLink or onError link, which both have retry capability. Take a look at those as well. Perhaps you’ll find a way to get this to work with createSubscriptionHandshakeLink.