From 9df152407fa1e0410266a33c2475b145a522cc47 Mon Sep 17 00:00:00 2001 From: Di Wu Date: Mon, 13 May 2024 16:05:47 -0700 Subject: [PATCH] resolve comments --- Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift | 1 - .../Operation/AWSGraphQLSubscriptionTaskRunner.swift | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift b/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift index 6a4841f13b..a1a450fd28 100644 --- a/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift +++ b/Amplify/Core/Support/AmplifyAsyncThrowingSequence.swift @@ -6,7 +6,6 @@ // import Foundation -import Combine public typealias WeakAmplifyAsyncThrowingSequenceRef = WeakRef> diff --git a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift index 9595c52bf0..b75a1e0a94 100644 --- a/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift +++ b/AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift @@ -114,8 +114,8 @@ public class AWSGraphQLSubscriptionTaskRunner: InternalTaskRunner, self.subscription = try await appSyncClient?.subscribe( id: subscriptionId, query: encodeRequest(query: request.document, variables: request.variables) - ).sink(receiveValue: { event in - self.onAsyncSubscriptionEvent(event: event) + ).sink(receiveValue: { [weak self] event in + self?.onAsyncSubscriptionEvent(event: event) }) } catch { let error = APIError.operationError("Unable to get connection for api \(endpointConfig.name)", "", error)