Closed rfc2822 closed 2 months ago
Maybe I misunderstand something here, but if we create the syncManager
in step 2. we would either
syncManagers
which can be used later to perform the syncs (step 3.) -> not very elegant ...I suggest we instead access the already existing remoteCalendars
map in step 3. using the localCalendar
"name" (url) to retrieve the db collection from the remoteCalendars
map and stick with creating the syncManager here, passing in the db collection before syncing.
What I mean: https://github.com/bitfireAT/davx5-ose/pull/881/commits/0fcb992ad0cba878e14ed53b96afd03ca8db8f05
have to perform the sync right away -> not good, because we have not yet created new local calendars
Yes, I thought we can create/update and & sync each calendar directly, without having to create/update/delete other calendars first.
However if it's cleanly possible to still do sync in step 3, even better, then the sync algorithm stays as it is and we have the collection available nevertheless.
However if it's cleanly possible to still do sync in step 3, even better, then the sync algorithm stays as it is and we have the collection available nevertheless.
Good, then I will do that for the other Syncers (Jtx, AddressBook, etc) as well now :+1:
Providing the respective database
Collection
to theSyncManager
will allow us to reduce our dependency of the content providers.For instance, we can then take the address book/calendar URL from the DB
Collection.url
field instead of caching it in the content provider and then taking it from there.Right now, we have two main steps in the
Syncer
(let's take theCalendarSyncer
as an example):updateLocalCalendars
: sync the DB collections of type "calendar" with the Android content provider (the collections themselves, not the contents)CalendarSyncManager
. In this step, we don't have the DB collection anymore, so we can't pass it to theSyncManager
.Now we want the DB collection to be available for the
SyncManager
. My approach would be to combine the main steps in theSyncer
:SyncManager
. So we call theSyncManager
here and pass the DBCollection
.