-
-
Notifications
You must be signed in to change notification settings - Fork 97
Support sync adapter pending sync indication on Android 14+ #1676
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
base: main-ose
Are you sure you want to change the base?
Support sync adapter pending sync indication on Android 14+ #1676
Conversation
38b5242
to
83e0e03
Compare
@rfc2822 I have added the migration, but it seems like no migrations run when I try to test like this:
How can I test the migration works? |
You have to increase KDoc for that constant is surely also a good idea. We should also mention it in the |
ah, yes. Of course ... Thank you! Will do 👍 |
So this is only needed for address book accounts? Can't there a sync be pending for normal accounts, too? |
Yes. When I test this with calendars instead of contacts, the pending flag will go a away as soon as the internet connection is active and the pending/scheduled sync runs. I don't need to edit an event for it to be cleared.
No, well ... maybe, but I don't know how to reproduce that scenario then. Is it different for you? If you want to we could of course add the calendar account(s) too, just to be sure ... |
I just wonder because |
The forever pending sync flag is definitely a thing for the calendars too, but I can't reproduce it with the app update (no idea why), so I thought there is no need to handle it in the migration. |
I just wonder whether we can rely on that or assume that there may be pending calendar syncs that don't go away for some users. These users would surely be irratated. Maybe also cancel pending calendar syncs to be on the secure side? |
Added 👍 |
app/src/main/kotlin/at/bitfire/davdroid/settings/migration/AccountSettingsMigration21.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/settings/migration/AccountSettingsMigration21.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/settings/migration/AccountSettingsMigration21.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/sync/adapter/SyncFrameworkIntegration.kt
Outdated
Show resolved
Hide resolved
@ArnyminerZ For reviewing please also use these steps; but instead of installing the 4.5.3 APK you can just checkout the v4.5.3-ose tag and install it from Android Studio. Then update
I wonder whether the problem can also be reproduced for events/tasks. But anyway if the update works and doesn't leave progress bars behind, I hope we're good. In worst case we have to disable the "sync pending" progress bar again for Android >= 14, but I don't hope so. |
7290310
to
96d0fa3
Compare
(I have rebased) Progress bar still there, tested like this:
And then just to be sure:
Seems to come from address books because when I open the account screen, the pending sync bar is in the CardDAV tab, but not in the CalDAV tab. Logs:
|
That is really strange, because it has been working fine for me. I will try your steps to reproduce |
PS After rebooting the emulator the pending sync is gone… |
You're right. Happens to me too. It also happens for calendars when adding the authorities to the call like this: What does seem to work is canceling the sync via request (with
So we will need to test canceling with the different sync flags On Android 16 in the logs I saw upload can be true and false too (not just on Android 7):
|
0287a2b
to
155618b
Compare
…ework syncs on Android 14+
a9ce43f
to
6ae10e9
Compare
@bitfireAT/app-dev I have updated the issue description too. Please check and let me know if you find an easier way to cancel the forever pending sync flag or know of an easier way to test it. misclicked Did not mean to close. |
Purpose
Cancel wrongly pending sync state.
Short description
Note: The added migration first creates dummy syncs for all authorities, then cancels by each authority specificly and then cancels one more time for all authorities using
null
as wildcard. I don't know why and please don't ask me why, but it seems like that's all needed to successfully clear the pending flag in the migration.In
SyncFrameworkIntegration.cancelSync
it seems to be enough to cancel the specific incoming sync request.Please double check. Maybe you want to try playing around with this PR too, where I added a FAB to cancel the syncs: #1691
You can also use list active, pending and periodic syncs with:
adb shell dumpsys content | grep -A 10 "Active Syncs"
Checklist