From 0ec6fba2ba06bfa47e8e22c54121a158312c4dc1 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 20 Jun 2024 14:59:13 +0300 Subject: [PATCH] Avoid races between enabling the send queue and receiving back a status update, stop dropping duplicates both here and on reachability status printing. --- ElementX/Sources/Application/AppCoordinator.swift | 1 - ElementX/Sources/Services/Client/ClientProxy.swift | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 46b83a40d..928c27db8 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -665,7 +665,6 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg let reachabilityNotificationIdentifier = "io.element.elementx.reachability.notification" ServiceLocator.shared.networkMonitor .reachabilityPublisher - .removeDuplicates() .sink { reachability in MXLog.info("Reachability changed to \(reachability)") diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index a2260fee7..e55d4e0bf 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -173,11 +173,10 @@ class ClientProxy: ClientProxyProtocol { }) sendQueueStatusSubject - .removeDuplicates() .combineLatest(networkMonitor.reachabilityPublisher) .debounce(for: 1.0, scheduler: DispatchQueue.main) .sink { enabled, reachability in - MXLog.info("Send queue status changed to enabled: \(enabled)") + MXLog.info("Send queue status changed to enabled: \(enabled), reachability: \(reachability)") if enabled == false, reachability == .reachable { MXLog.info("Enabling all send queues")