Kozea / Radicale

A simple CalDAV (calendar) and CardDAV (contact) server.
https://radicale.org
GNU General Public License v3.0
3.33k stars 431 forks source link

Support filters #33

Closed liZe closed 8 years ago

liZe commented 11 years ago

We should implement the filters support in CalDAV, and see if it helps some clients (seems to be very useful for Apple's clients).

If this is finally useless for supported clients, just close that bug.

dmfs commented 11 years ago

+1 We've received reports that CalDAV-Sync might not sync properly if there are tasks and events in the same collection. The problem is that CalDAV-Sync relies on the server to filter the results by component (i.e. VTODO or VEVENT). If the app receives VEVENTs when it send a request for VTODOs only (or vice versa) it might sync infinitely. While this is something that I have to fix on my end it might be useful to have filtering working properly in Radicale. In Android we sync tasks and events separately so we rely on the sever capabilities to filter correctly.

Is there already someone working on this? Are there any specific plans how to implement it? Maybe I can help out.

liZe commented 11 years ago

Adding filters for component types is possible, actually it's almost done: https://github.com/Kozea/Radicale/blob/master/radicale/xmlutils.py#L466

I suppose that CalDAV-Sync uses nested filters, that's why it does not work. There's a TODO about that in the code, it should be quite easy to handle this as it already works for flat filters, if you know a little bit of Python of course. If you don't, just ask, I can try to fix that within a couple of weeks.

The plan is to add features about filters only if they are needed by clients. Adding support for nested filters is a useful feature that can be achieved with simple specific code, so that's OK (and I'll be really grateful if you do :wink:). Creating a generic way of handling filters is a bad idea, because it's way too complicated.

dmfs commented 11 years ago

Yes, CalDAV-Sync uses nested filters. I'll check the code to see what I can do.

liZe commented 11 years ago

After checking the code, it should actually work with nested filters. Radicale mixes parents and children in filters (that's bad, and the TODO is for this), but that should not be a problem with clients. If you have interesting logs with CalDAV-Sync, you can pastebin them, I'll try to find where the bug comes from.

dmfs commented 11 years ago

Interesting. I'll check out the sources and give it a try. I'll let you know what I find out.

dmfs commented 11 years ago

You're right the git version properly filters the results by component type. I'll ask the reporting user which version he uses.

liZe commented 8 years ago

Only missing recurrence rules now.