Skip to content

Commit

Permalink
feat: background sync even if interval not passed
Browse files Browse the repository at this point in the history
this avoids the scenario of:
1. study some cards
2. leave the app within a time less than 10 minutes (so autosync isn't triggered)
3. open the app again and have the wait the studied cards in `1.` to be synced, although they could have been already synced in the background

that also indirectly makes media sync to run in every app startup. Not sure if that should be kept or avoided
  • Loading branch information
BrayanDSO committed Apr 1, 2024
1 parent 15e4ae9 commit 6157fa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ open class DeckPicker :
!isAutoSyncEnabled -> Timber.d("autoSync: not enabled")
isBlockedByMeteredConnection -> Timber.d("autoSync: blocked by metered connection")
!NetworkUtils.isOnline -> Timber.d("autoSync: offline")
!syncIntervalPassed() -> Timber.d("autoSync: sync interval not passed")
!runInBackground && !syncIntervalPassed() -> Timber.d("autoSync: interval not passed")
!isLoggedIn() -> Timber.d("autoSync: not logged in")
mediaMigrationIsInProgress(this) -> Timber.d("autoSync: migrating storage")
!areThereChangesToSync() -> {
Expand Down

0 comments on commit 6157fa7

Please sign in to comment.