From 490ebb5bdeab377eff985535f06e88451e59dcf5 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 7 Nov 2025 12:09:36 +0100 Subject: [PATCH] Restart subscriptions after token refresh In case the connection got lost and the client reconnected again, there is a possibility that the auth token is expired. This will lead to the subscription to fail due to being unauthorized. This, however, does not close the connection and the heartbeat messages are still being sent and received. Thus, after refreshing the token, the connection is still alive but not authorized, which is the same as not having the connection open. --- src/lib/requests/client/GraphQLClient.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/requests/client/GraphQLClient.ts b/src/lib/requests/client/GraphQLClient.ts index 8abd8dc1..e7494d20 100644 --- a/src/lib/requests/client/GraphQLClient.ts +++ b/src/lib/requests/client/GraphQLClient.ts @@ -275,6 +275,11 @@ export class GraphQLClient extends BaseClient< return fromPromise(BaseClient.refreshAccessToken(this.handleRefreshToken)) .filter(Boolean) + .map((result) => { + this.restartAllSubscriptions(); + + return result; + }) .flatMap(() => forward(operation)); }); }