diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt index 15dc9941e..174173fbf 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt @@ -178,6 +178,7 @@ class ApolloSubscriptionProtocolHandler( } private fun onDisconnect(context: WsContext): Flow { + logger.debug("Session \"${context.sessionId}\" disconnected") sessionState.terminateSession(context, CloseStatus(1000, "Normal Closure")) return emptyFlow() } diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionSessionState.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionSessionState.kt index ea58b56af..50dff9498 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionSessionState.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionSessionState.kt @@ -90,7 +90,7 @@ internal class ApolloSubscriptionSessionState { code: CloseStatus, ) { sessionToOperationId.remove(context.sessionId)?.forEach { - activeOperations[it]?.cancel() + removeActiveOperation(it) } cachedGraphQLContext.remove(context.sessionId) context.closeSession(code)