From f7488e3ab80fa25a5fdc9260de14e9043df3bdb3 Mon Sep 17 00:00:00 2001 From: Almas Daumov <85210232+almasios@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:19:14 -0500 Subject: [PATCH] fix(api): AWSGraphQLSubscriptionTaskRunner failing to cancel AppSyncRealTimeSubscription (#3615) --- .../Operation/AWSGraphQLSubscriptionTaskRunner.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift index 3f3889566a..13cba6b888 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift @@ -46,10 +46,7 @@ public class AWSGraphQLSubscriptionTaskRunner: InternalTaskRunner, public func cancel() { self.send(GraphQLSubscriptionEvent.connection(.disconnected)) - Task { [weak self] in - guard let self else { - return - } + Task { guard let appSyncClient = self.appSyncClient else { return }