Skip to content
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: use constants instead of authorities where applicable #880

Open
4 tasks
rfc2822 opened this issue Jul 3, 2024 · 0 comments
Open
4 tasks

Sync: use constants instead of authorities where applicable #880

rfc2822 opened this issue Jul 3, 2024 · 0 comments
Labels
refactoring Internal improvement of existing functions

Comments

@rfc2822
Copy link
Member

rfc2822 commented Jul 3, 2024

We have many locations where we use the various authorities in the meaning of the Android sync framework to specify what to synchronize.

However, we don't use the sync framework anymore for most syncs, and also the mapping of authorities to what shall be synchronized is not 1:1:

  • Address books authority (R.string.address_books_authority) – Needed because main accounts are not synchronized with the ContactsContract.AUTHORITY. This is because a main account doesn't contain contacts directly, but only address book accounts, which then contain the contacts. So if we want to sync all address books of an account, we currently use the address books authority.

  • CalendarContract.AUTHORITY – Currently used as intended without extra workarounds.

  • Task authorities for jtxBoard, tasks.org and OpenTasks – Instead, we often want to just have "tasks". For instance, there should be a tasks sync interval, and not a jtxBoard sync interval, tasks.org sync interval etc. So most occurrences of these authorities will have to be replaced by a "tasks" constant.

  • Go through all occurences of authorities and see whether the location really requires an authority in the sync framework meaning or should be replaced by a {contacts, calendar, tasks} enum or something like that.

    • Probably change AccountSettings sync interval getters/setters to not require authorities.
    • Probably change the workers to accept the enum instead of authorities.
  • Check/adapt TasksAppWatcher

@rfc2822 rfc2822 added the refactoring Internal improvement of existing functions label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions
Projects
Status: Todo
Development

No branches or pull requests

1 participant