From 501a1d5cb29abc64d43a9c40ed121ddff0c32d18 Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Mon, 2 Dec 2024 17:12:44 -0300 Subject: [PATCH] =?UTF-8?q?Rename=20Subscription=E2=80=99s=20`finish`=20me?= =?UTF-8?q?thod=20to=20`unsubscribe`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I don’t think that this method should exist at all; the intention for our public API, as described in 20e7f5f, is that the user should not need to explicitly unsubscribe. (We have #36 for figuring out how to implement the appropriate cleanup.) However, this method does now exist, and we’re probably not going to get rid of it before beta, so we agreed in standup today to at least name it in line with JS. --- Sources/AblyChat/Subscription.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/AblyChat/Subscription.swift b/Sources/AblyChat/Subscription.swift index 8c46fc4d..b35ba838 100644 --- a/Sources/AblyChat/Subscription.swift +++ b/Sources/AblyChat/Subscription.swift @@ -72,7 +72,7 @@ public struct Subscription: Sendable, AsyncSequence { } // TODO: https://github.com/ably-labs/ably-chat-swift/issues/36 Revisit how we want to unsubscribe to fulfil CHA-M4b & CHA-ER4b. I think exposing this publicly for all Subscription types is suitable. - public func finish() { + public func unsubscribe() { switch mode { case let .default(_, continuation): continuation.finish()