Yes it download all files.
This should be changed, but I don’t know where and how.
(Also the calendar sync shouldn’t download the VTODOs)
That’s what I meant. I see two possibilities:
- to query only resources with the needed components (VEVENT/VTODO), i.e. using CALDAV:calendar-query report instead of PROPFIND, or
- to implement set operations that allow to merge and split events and todos locally as well as remote.
Solution 2 would be far more complex. Also, Android architecture demands a separate sync adapter for each “authority”, so there should be one sync adapter for address books, one for calendars and one for to-dos (as you have implemented it) that run separately.
So I’d prefer solution 1, but I don’t know how most CalDAV servers implement it. »Support for the CALDAV:calendar-query REPORT is REQUIRED«, but I know that many servers don’t implement it (correctly). Radicale, for instance, seems to always return all resources for any
calendar-query: in this case, all resources would be downloaded (and thrown away) for every sync run, but at least it would work.
Another problem is that in the current implementation not only the ETags, but all resources would downloaded for every sync run (they are not stored anywhere, so at the next run, they will be downloaded again). This means that for my current setup with Radicale, every sync run would download thousands of resources every time. I guess that many users won’t accept that and complain and create “DAVdroid is using all my traffic and battery” tickets.
So, more information about how real CalDAV servers handle
calendar-query with component selection is needed. Maybe somone can help with testing?