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)