From 282b0f3368dada6deaf401984847991437c087f4 Mon Sep 17 00:00:00 2001 From: Sunghwan Bang Date: Mon, 2 Dec 2024 13:27:55 +0900 Subject: [PATCH] Fixed client complete abort websocket that is sending ManagedWebSocket.SendAsync abort the connection when a cancellation is raised. OperationSession cancel reading the response stream and sending when the client sends a complete message. This PR fixes multiple operation being aborted by a completing operation. --- .../src/AspNetCore/Subscriptions/OperationSession.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/OperationSession.cs b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/OperationSession.cs index b421740a3cf..6bc08aa6582 100644 --- a/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/OperationSession.cs +++ b/src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/OperationSession.cs @@ -74,7 +74,8 @@ await _session.Protocol.SendErrorMessageAsync( { try { - await SendResultMessageAsync(item, ct); + // use original cancellation token here to keep the websocket open for other streams. + await SendResultMessageAsync(item, cancellationToken); } finally {