diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a942bda..8528af80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 3.3.2.dev * Fix: debug logging in rights/from_file * Add: option [storage] use_cache_subfolder_for_item for storing item cache outside collection-root +* Fix: ignore empty RRULESET in item ## 3.3.1 diff --git a/radicale/item/filter.py b/radicale/item/filter.py index 61b7c1b4..209bd1cb 100644 --- a/radicale/item/filter.py +++ b/radicale/item/filter.py @@ -2,7 +2,8 @@ # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2015 Guillaume Ayoub -# Copyright © 2017-2018 Unrud +# Copyright © 2017-2021 Unrud +# Copyright © 2024-2024 Peter Bieringer # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -273,8 +274,11 @@ def visit_time_ranges(vobject_item: vobject.base.Component, child_name: str, if hasattr(comp, "recurrence_id") and comp.recurrence_id.value: recurrences.append(comp.recurrence_id.value) if comp.rruleset: - # Prevent possible infinite loop - raise ValueError("Overwritten recurrence with RRULESET") + if comp.rruleset._len is None: + logger.warning("Ignore empty RRULESET in item at RECURRENCE-ID with value '%s' and UID '%s'", comp.recurrence_id.value, comp.uid.value) + else: + # Prevent possible infinite loop + raise ValueError("Overwritten recurrence with RRULESET") rec_main = comp yield comp, True, [] else: diff --git a/radicale/tests/static/event_exdate_without_rrule.ics b/radicale/tests/static/event_exdate_without_rrule.ics new file mode 100644 index 00000000..ed6027da --- /dev/null +++ b/radicale/tests/static/event_exdate_without_rrule.ics @@ -0,0 +1,55 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:DAVx5/4.4.3.2-ose ical4j/3.2.19 +BEGIN:VEVENT +DTSTAMP:20241125T195941Z +UID:9fb6578a-07a6-4c61-8406-69229713d40e +SEQUENCE:3 +SUMMARY:Escalade +DTSTART;TZID=Europe/Paris:20240606T193000 +DTEND;TZID=Europe/Paris:20240606T203000 +RRULE:FREQ=WEEKLY;WKST=MO;BYDAY=TH +EXDATE;TZID=Europe/Paris:20240704T193000 +CLASS:PUBLIC +STATUS:CONFIRMED +BEGIN:VALARM +TRIGGER:-P1D +ACTION:DISPLAY +DESCRIPTION:Escalade +END:VALARM +END:VEVENT +BEGIN:VEVENT +DTSTAMP:20241125T195941Z +UID:9fb6578a-07a6-4c61-8406-69229713d40e +RECURRENCE-ID;TZID=Europe/Paris:20241128T193000 +SEQUENCE:1 +SUMMARY:Escalade avec Romain +DTSTART;TZID=Europe/Paris:20241128T193000 +DTEND;TZID=Europe/Paris:20241128T203000 +EXDATE;TZID=Europe/Paris:20240704T193000 +CLASS:PUBLIC +STATUS:CONFIRMED +BEGIN:VALARM +TRIGGER:-P1D +ACTION:DISPLAY +DESCRIPTION:Escalade avec Romain +END:VALARM +END:VEVENT +BEGIN:VTIMEZONE +TZID:Europe/Paris +BEGIN:STANDARD +TZNAME:CET +TZOFFSETFROM:+0200 +TZOFFSETTO:+0100 +DTSTART:19961027T030000 +RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU +END:STANDARD +BEGIN:DAYLIGHT +TZNAME:CEST +TZOFFSETFROM:+0100 +TZOFFSETTO:+0200 +DTSTART:19810329T020000 +RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU +END:DAYLIGHT +END:VTIMEZONE +END:VCALENDAR diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index 6440542f..69864366 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -1,6 +1,7 @@ # This file is part of Radicale - CalDAV and CardDAV server # Copyright © 2012-2017 Guillaume Ayoub -# Copyright © 2017-2019 Unrud +# Copyright © 2017-2022 Unrud +# Copyright © 2024-2024 Peter Bieringer # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -166,6 +167,12 @@ permissions: RrWw""") event = get_file_content("event_mixed_datetime_and_date.ics") self.put("/calendar.ics/event.ics", event) + def test_add_event_with_exdate_without_rrule(self) -> None: + """Test event with EXDATE but not having RRULE.""" + self.mkcalendar("/calendar.ics/") + event = get_file_content("event_exdate_without_rrule.ics") + self.put("/calendar.ics/event.ics", event) + def test_add_todo(self) -> None: """Add a todo.""" self.mkcalendar("/calendar.ics/")