-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync on collection update #1240
base: main-ose
Are you sure you want to change the base?
Sync on collection update #1240
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how this behaves when the services are refreshed. Doesn't it enqueue a lot of syncs during service detection (whenever a collection is updated)?
My ideas (may or may not make sense):
- A delay of a few seconds between the collection change and the sync (like for the push registration) could at least reduce the number of synchronizations during service detection.
- Or maybe pause it somehow?
- Maybe separate callbacks for the actions we want to observe (update read-only, update sync flag)? Has advantages and disadvantages.
app/src/main/kotlin/at/bitfire/davdroid/sync/worker/SyncWorkerManager.kt
Outdated
Show resolved
Hide resolved
945029e
to
7f58df8
Compare
f9a0940
to
7d4bca1
Compare
Hm, because we're not sure about unwanted consequences (regarding service detection etc) Maybe we could the sync from the UI? So that not the DB Collection is observed, but instead when the user changes the read-only / sync flag in the UI, it waits a few seconds and then starts a sync? |
Sure, we should drop #1230 then though, since we don't want that feature anymore? |
I mean we could sync when they're (un)checked by the user in the UI, but not when the sync flag is modified by for instance some background code. |
But maybe let's do it after the other 4.5 things and could also be good to discuss (dis)advantages in a talk |
Purpose
Nice to have for:
Short description
SyncWorkerManager
listen to any collection changes and use the account passed along toChecklist