Cleanup the background task that pauses the SDK when resigning active (#903)

* checking if the stop taskHandle is finished before stopping the bg task

* stopping the sync in background now works properly

* this will prevent the case in which if the app suspends and then is immediately foregrounded again, we do not start the sync

* now works as intended

* code improvement

* improved the code a bit
This commit is contained in:
Mauro
2023-05-19 10:28:30 +02:00
committed by GitHub
parent 03dece7bf4
commit 4e46c01945
5 changed files with 46 additions and 16 deletions
@@ -33,6 +33,8 @@ class MockClientProxy: ClientProxyProtocol {
var invitesSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
var avatarURLPublisher: AnyPublisher<URL?, Never> { Empty().eraseToAnyPublisher() }
var isSyncing: Bool { false }
internal init(userID: String, roomSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()) {
self.userID = userID
@@ -43,6 +45,8 @@ class MockClientProxy: ClientProxyProtocol {
func startSync() { }
func stopSync(completionHandler: () -> Void) { }
func stopSync() { }
func directRoomForUserID(_ userID: String) async -> Result<String?, ClientProxyError> {