From bab35e9692c6e31b88672aaa2f7a778a34a3b8cd Mon Sep 17 00:00:00 2001 From: Unrud Date: Wed, 7 Jun 2017 21:54:38 +0200 Subject: [PATCH 1/2] Detect errors in recurrence rules early --- radicale/storage.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/radicale/storage.py b/radicale/storage.py index f77143ce..75099cab 100644 --- a/radicale/storage.py +++ b/radicale/storage.py @@ -118,9 +118,16 @@ def check_item(vobject_item): """Check vobject items for common errors.""" if vobject_item.name == "VCALENDAR": for component in vobject_item.components(): - if (component.name in ("VTODO", "VEVENT", "VJOURNAL") and - not get_uid(component)): + if component.name not in ("VTODO", "VEVENT", "VJOURNAL"): + continue + if not get_uid(component): raise ValueError("UID in %s is missing" % component.name) + # vobject interprets recurrence rules on demand + try: + component.rruleset + except Exception as e: + raise ValueError("invalid recurrence rules in %s" % + component.name) from e elif vobject_item.name == "VCARD": if not get_uid(vobject_item): raise ValueError("UID in VCARD is missing") From 30a41050652edbb48e99952c22db6fb46226ca89 Mon Sep 17 00:00:00 2001 From: Unrud Date: Wed, 7 Jun 2017 21:54:49 +0200 Subject: [PATCH 2/2] Add TODO comments for time ranges --- radicale/xmlutils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index d56141e0..2c25e908 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -278,6 +278,15 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn): """ child = getattr(vobject_item, child_name.lower()) + + # TODO: Recurrences specified with RDATE + # (http://www.kanzaki.com/docs/ical/rdate.html) don't seem to work + # correct in VObject. getrruleset(addRDate=True) returns an empty generator + # if they are used. + # TODO: Single recurrences can be overwritten by components with + # RECURRENCE-ID (http://www.kanzaki.com/docs/ical/recurrenceId.html). They + # are currently ignored but can change the start and end time. + # Comments give the lines in the tables of the specification if child_name == "VEVENT": # TODO: check if there's a timezone