Bump SDK to v1.0.107-alpha. Simplify syncService state handling

This commit is contained in:
Stefan Ceriu
2023-08-16 13:24:43 +03:00
committed by Stefan Ceriu
parent 8d409e7817
commit 5400910855
8 changed files with 30 additions and 52 deletions
@@ -538,7 +538,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
// MARK: - Application State
private func stopSync() {
userSession?.clientProxy.pauseSync()
userSession?.clientProxy.stopSync()
clientProxyObserver = nil
}
@@ -595,7 +595,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
@objc
private func applicationWillTerminate() {
userSession?.clientProxy.pauseSync()
userSession?.clientProxy.stopSync()
}
@objc
@@ -609,7 +609,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
backgroundTask = backgroundTaskService.startBackgroundTask(withName: "SuspendApp: \(UUID().uuidString)") { [weak self] in
guard let self else { return }
userSession?.clientProxy.pauseSync()
userSession?.clientProxy.stopSync()
backgroundTask?.stop()
backgroundTask = nil
@@ -629,7 +629,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
backgroundTask?.stop()
backgroundTask = nil
if isSuspended, userSession?.clientProxy.isSyncing == false {
if isSuspended {
startSync()
}
@@ -681,9 +681,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
return
}
if !userSession.clientProxy.isSyncing {
startSync()
}
startSync()
// Be a good citizen, run for a max of 10 SS responses or 10 seconds
// An SS request will time out after 30 seconds if no new data is available