Skip to content

Commit 65210b7

Browse files
committed
Sync: add more safety to avoid some race conditions
1 parent 785c4a5 commit 65210b7

File tree

1 file changed

+1
-3
lines changed
  • libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync

1 file changed

+1
-3
lines changed

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/sync/RustSyncService.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ class RustSyncService(
5858
.map(RoomListServiceState::toSyncState)
5959
.onEach { state ->
6060
Timber.v("Sync state=$state")
61-
if (state == SyncState.InError || state == SyncState.Terminated) {
62-
isSyncing.set(false)
63-
}
61+
isSyncing.set(state == SyncState.Syncing)
6462
}
6563
.distinctUntilChanged()
6664
.stateIn(sessionCoroutineScope, SharingStarted.Eagerly, SyncState.Idle)

0 commit comments

Comments
 (0)