You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Stalwart test failures: add compatibility hints and guards
Three tests for TestForServerStalwart were failing:
- testTodoDatesearch (assert 3==5, then DTSTART expansion check)
- testRecurringDateSearch (assert 0==1)
- testRecurringDateWithExceptionSearch (assert 3==2)
Compatibility hints added for Stalwart:
- search.recurrences.includes-implicit.event: fragile (works for
datetime events but not for all-day/VALUE=DATE events)
- search.recurrences.includes-implicit.todo: fragile (server returns
recurring todos but expansion doesn't work reliably)
- search.recurrences.expanded.exception: unsupported (server-side
expansion is wrong for events with exceptions)
- save-load.event.recurrences.exception: unsupported (Stalwart stores
master+exception VEVENTs as separate calendar objects)
- vtodo_datesearch_nodtstart_task_is_skipped old_flag (already existed
in prior commits but consolidated here)
- no_search_openended old_flag (open-ended VTODO date searches fail)
Library behavior change (search.py): when expand=True is requested and
the server splits exception VEVENTs into separate objects (unsupported
save-load.event.recurrences.exception), automatically fall back to
server-side CALDAV:expand when the server supports it correctly.
Test changes:
- testRecurringDateWithExceptionSearch: guard "assert len(r)==2" and
"assert len(rs)==2" for servers that can't handle exceptions; the rs
assertion now also requires expanded.exception support
- testTodoDatesearch: guard isinstance(todos[0]) assertions with
no_search_openended flag (consolidating todos1/todos2/todos3 under
one condition)
New FEATURES entry: save-load.event.recurrences.exception
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,9 +27,15 @@ This project should adhere to [Semantic Versioning](https://semver.org/spec/v2.0
27
27
* Fixed inconsistent URL quoting for calendar object UIDs containing slashes -- both `_generate_url()` and `_find_id_and_path()` in `calendarobject_ops.py` now share a single `_quote_uid()` helper (related to https://github.com/python-caldav/caldav/issues/143).
28
28
* Fixed `expand_simple_props()` return value handling.
29
29
30
+
### Added (compatibility)
31
+
32
+
* New feature flag `save-load.event.recurrences.exception` to express whether the server stores master+exception VEVENTs as a single calendar object (per RFC) or splits them into separate objects. When a server stores them separately, `expand=True` searches now automatically fall back to server-side `CALDAV:expand` (when supported), since client-side expansion of the master alone would otherwise yield duplicate occurrences.
33
+
* Added Stalwart compatibility hints: `search.recurrences.includes-implicit.event` (fragile — broken for all-day/VALUE=DATE events), `search.recurrences.includes-implicit.todo` (fragile), `search.recurrences.expanded.exception` (unsupported), `save-load.event.recurrences.exception` (unsupported — exceptions stored as separate objects), `vtodo_datesearch_nodtstart_task_is_skipped` and `no_search_openended` old-flags.
34
+
30
35
### Test Framework
31
36
32
37
* Added async rate-limit unit tests matching the sync test suite.
38
+
* caldav-server-tester: `CheckRecurrenceSearch` now also verifies implicit recurrence support for all-day (VALUE=DATE) recurring events, marking the feature as `fragile` (with behaviour description) when only datetime recurring events work.
Copy file name to clipboardExpand all lines: caldav/compatibility_hints.py
+30-1Lines changed: 30 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,16 @@ class FeatureSet:
130
130
"save-load.event": {"description": "it's possible to save and load events to the calendar"},
131
131
"save-load.event.recurrences": {"description": "it's possible to save and load recurring events to the calendar - events with an RRULE property set, including recurrence sets"},
132
132
"save-load.event.recurrences.count": {"description": "The server will receive and store a recurring event with a count set in the RRULE", "default": {"support": "full"}},
133
+
## This was Claude's suggestion and it works as of today, the
134
+
## "unsupported" description matches the behaviour of the Stalwart server.
135
+
## Stalwart apparently (in a breach with the RFC) stores the exception
136
+
## information as a separate CalendarObjectResource.
137
+
## Currently the search logic will do server-side expansion
138
+
## if this flag is set to "unsupported", which is the correct behaviour for Stalwart.
139
+
## The problem is that logically, this feature would also be "unsupported" if the exception
140
+
## information was simply discarded, and the current search behaviour would in
141
+
## such a case be incorrect if the exception is simply discarded.
142
+
"save-load.event.recurrences.exception": {"description": "When a VCALENDAR containing a master VEVENT (with RRULE) and exception VEVENT(s) (with RECURRENCE-ID) is stored, the server keeps them together as a single calendar object resource. When unsupported, the server splits exception VEVENTs into separate calendar objects, making client-side expansion unreliable (the master expands without knowing about its exceptions)."},
133
143
"save-load.todo": {"description": "it's possible to save and load tasks to the calendar"},
134
144
"save-load.todo.recurrences": {"description": "it's possible to save and load recurring tasks to the calendar"},
135
145
"save-load.todo.recurrences.count": {"description": "The server will receive and store a recurring task with a count set in the RRULE", "default": {"support": "full"}},
0 commit comments