-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Remove address books sync authority and content provider #877
Remove address books sync authority and content provider #877
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.
This may technically work, but it would be difficult to understand because the (main) accounts are not syncable for contacts. So it's not understandable why we'd use the contacts authority with them.
I suggest to keep R.string.address_books_authority
, make sure that it's only a constant (i.e. it doesn't actually refer to a content provider) and just remove the content provider.
In a separate PR, we should replace the authorities by CONTACTS/CALENDAR/TASKS constants where this makes more sense. I'll create a new issue for that.
app/src/main/kotlin/at/bitfire/davdroid/repository/AccountRepository.kt
Outdated
Show resolved
Hide resolved
See #880 |
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.
Looks good, but there are problems:
-
After creating an account with our test server, address books are correctly detected, but the account settings don't have a "contacts sync" interval:
-
Address book synchronization doesn't work:
D [settings.AccountSettings] Account [email protected] has version 15, current version: 15
I [sync.worker.BaseSyncWorker] Manual sync, skipping network checks
E Failed to find provider info for at.bitfire.davdroid.addressbooks
W [sync.worker.BaseSyncWorker] Couldn't acquire ContentProviderClient for at.bitfire.davdroid.addressbooks
I [sync.worker.BaseSyncWorker] OneTimeSyncWorker finished for sync-at.bitfire.davdroid.addressbooks bitfire.at.davdroid/[email protected]
I think providing the ContentProviderClient
is not responsibility of the BaseSyncWorker
– the Syncers should acquire the required content provider client themself. The worker should just handle a possible error.
1a5cbbb
to
a1d0ce8
Compare
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.
Looks like we don't (and didn't?) show a notification when the content provider can't be acquired. This can happen when the contacts or calendar permission is revoked (which can also happen automatically!) or the user disables the contacts storage app.
Steps to reproduce:
- Set up DAVx5 with contacts and calendar sync.
- Remove contacts/calendar permission.
- Sync either from DAVx5 (which shows a warning in the UI, but it can't be seen when the user doesn't open DAVx5) or just wait for the next sync.
- There's no notification that sync is broken.
Expected: There should be a notification.
As far as I have seen, there was no notification before this PR, too. Is that possible? 😄 Please check and then:
- If there is currently (before applying the PR) also no notification in this case, we don't have to handle the case in this PR. Instead add that information to Sync: re-factor error handling #887.
- If the is currently a notification in this case, this PR shouldn't make it worse, so we'd have to also show a notification when the PR is applied. Improving and refactoring sync error handling is then task of Sync: re-factor error handling #887.
(And we can also move the SyncAdapterServices.kt
out of the .adapter
package again, because we don't need a package if there's only one class in it.)
There was no notification before this PR either :) I have added the todo item in #887 |
There's still a merge conflict in SyncerTest |
No, I don't think so. Not locally for me at least straight after pulling and not on the latest commit on github either. Also the tests should have failed then, no? |
…rity-content-provider
Oh that one! |
Purpose
Before using workers for automatic sync, we needed the "address books" sync authority and content provider so that sync intervals could be set for address books. There is no other purpose for the address book sync authority and so we can remove it now.
Short description
This PR removes both the address books sync authority and content provider and updates usages.
Checklist