diff --git a/radicale/storage.py b/radicale/storage.py index f77143c..75099ca 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") diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index d56141e..2c25e90 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