From 2923be3791e6168d36e061171f5231d1a0f0094d Mon Sep 17 00:00:00 2001 From: Lawrence Forooghian Date: Thu, 14 Nov 2024 09:00:13 -0300 Subject: [PATCH] Trigger RETRY operation where spec says to Based on spec at 8ff947d. Resolves #50. --- Sources/AblyChat/RoomLifecycleManager.swift | 44 +++++- .../DefaultRoomLifecycleManagerTests.swift | 146 ++++++++++++++++-- 2 files changed, 171 insertions(+), 19 deletions(-) diff --git a/Sources/AblyChat/RoomLifecycleManager.swift b/Sources/AblyChat/RoomLifecycleManager.swift index ca8141f1..698ab4b4 100644 --- a/Sources/AblyChat/RoomLifecycleManager.swift +++ b/Sources/AblyChat/RoomLifecycleManager.swift @@ -188,7 +188,8 @@ internal actor DefaultRoomLifecycleManager, error: ARTErrorInfo) case suspended(retryOperationID: UUID, error: ARTErrorInfo) case failed(error: ARTErrorInfo) case releasing(releaseOperationID: UUID) @@ -210,7 +211,7 @@ internal actor DefaultRoomLifecycleManager Task { + logger.log(message: "Scheduling operation \(kind)", level: .debug) + return Task { + logger.log(message: "Performing scheduled operation \(kind)", level: .debug) + switch kind { + case let .retry(triggeringContributor, errorForSuspendedStatus): + await performRetryOperation( + triggeredByContributor: triggeringContributor, + errorForSuspendedStatus: errorForSuspendedStatus + ) + } + } + } + // MARK: - ATTACH operation internal func performAttachOperation() async throws { @@ -781,9 +810,16 @@ internal actor DefaultRoomLifecycleManager