Avoid races between enabling the send queue and receiving back a status update, stop dropping duplicates both here and on reachability status printing.
This commit is contained in:
committed by
Stefan Ceriu
parent
8ece1b00ee
commit
0ec6fba2ba
@@ -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)")
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user