Skip to content

Commit

Permalink
websockets: avoid duplicate resolve call
Browse files Browse the repository at this point in the history
* Due to inheritance, we were calling
  `resolve(execution_result.data)` twice.
  • Loading branch information
oliver-sanders committed Jan 10, 2024
1 parent 6c6a2b4 commit 65b274f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cylc/uiserver/websockets/tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from asyncio.queues import QueueEmpty
from tornado.websocket import WebSocketClosedError
from graphql.execution.middleware import MiddlewareManager
from graphql_ws.base import ConnectionClosedException
from graphql_ws.base import ConnectionClosedException, BaseSubscriptionServer
from graphql_ws.base_async import (
BaseAsyncConnectionContext,
BaseAsyncSubscriptionServer
Expand Down Expand Up @@ -165,4 +165,11 @@ async def send_execution_result(self, connection_context, op_id, execution_resul
await resolve(execution_result.data)
request_context = connection_context.request_context
await request_context['resolvers'].flow_delta_processed(request_context, op_id)
await super().send_execution_result(connection_context, op_id, execution_result)

# NOTE: skip TornadoSubscriptionServer.send_execution_result because it
# calls "resolve" then invokes BaseSubscriptionServer.send_execution_result
BaseSubscriptionServer.send_execution_result(
connection_context,
op_id,
execution_result,
)

0 comments on commit 65b274f

Please sign in to comment.