-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Move local collection management from companion objects to LocalDataStore #1125
Conversation
- note that things like the "sync_enabled" Android calendar flag are not supported and always set to true
d5c4991
to
fbdf465
Compare
@sunkup Can you please have a look and adapt the tests? ( |
a045a60
to
465c109
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.
@rfc2822 I have fixed the tests using mockk injection - which is really cool I think. There is some small stuff left, but it looks really good to me otherwise and sync seems to work just fine.
app/src/main/kotlin/at/bitfire/davdroid/resource/LocalAddressBook.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/resource/LocalAddressBookStore.kt
Outdated
Show resolved
Hide resolved
Incorporated the suggestions. I wonder how/whether we could test the stores as well. If you have ideas, please go ahead @sunkup |
I will mockk around some more ;) |
4ffb675
to
479e94c
Compare
479e94c
to
2b9ea3c
Compare
Purpose
Refactors the code by relocating the management of local collections from companion objects to a dedicated LocalDataStore interface + implementations.
Goal is to explicitly define who is responsible for managing (CRUD) local collections (address books, calendars etc). Usage of DI allows to fetch settings in the specific implementations, which makes calling classes like the
Syncer
sub-classes much shorter.TODO:
Short description
LocalDataStore
interface, which is responsible for managing local collections (= the ones accessed over a content provider).Checklist