Skip to content

Commit

Permalink
Do not cancel current sync request when going to background #5621
Browse files Browse the repository at this point in the history
Incremental sync can be long and it requires the user to wait for the treatment to end, else all is restarted from the beginning each time the user moves the app to foreground.
  • Loading branch information
bmarty committed Apr 7, 2022
1 parent dbf10a2 commit ea65547
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/5719.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not cancel the current incremental sync request and treatment when the app goes to background
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
Timber.tag(loggerTag.value).d("Pause sync...")
isStarted = false
retryNoNetworkTask?.cancel()
syncScope.coroutineContext.cancelChildren()
// Do not cancel the current incremental sync.
// Incremental sync can be long and it requires the user to wait for the treatment to end,
// else all is restarted from the beginning each time the user moves the app to foreground.
Timber.tag(loggerTag.value).d("Pause sync... Not cancelling incremental sync")
// syncScope.coroutineContext.cancelChildren()
}
}

Expand Down

0 comments on commit ea65547

Please sign in to comment.