Skip to content

Commit 48e8e5c

Browse files
committed
fix: testCheckCompatibility now catches subfeatures collapsed by compact=True
compact=True triggers collapse() which mutates _server_features by removing subfeatures that roll up into a parent. The guard `feature not in fo._server_features` then wrongly treats those tested-but-collapsed features as "never tested", silently skipping the assertion. Fix: snapshot _server_features.keys() before calling dotted_feature_set_list (compact=True), and use that snapshot in the guard. Also update compatibility matrices for Xandikos and Stalwart: search.recurrences.expanded.exception is now observed as supported on both servers (the previously documented bugs appear to be fixed in current versions). prompt: Running the compatibility tests (which again runs code from ~/caldav-server-tester), I find this: For servers Xandikos, Stalwart: search.recurrences.expanded.exception found to be supported, compatibility matrix says it's not supported. Despite this, the compatibility test passes - why? The test should break when differences are found, except for if feature support is "fragile" or "unknown". please fix AI Prompts: claude-sonnet-4-6: In this branch, the following tests are broken: FAILED tests/test_async_integration.py::TestAsyncForOx::test_object_by_uid - caldav.lib.error.PutError: PutError at '409 Conflict FAILED tests/test_caldav.py::TestForServerDavical::testRecurringDateWithExceptionSearch - KeyError: 'RECURRENCE-ID' FAILED tests/test_caldav.py::TestForServerCyrus::testRecurringDateWithExceptionSearch - KeyError: 'RECURRENCE-ID' ERROR tests/test_caldav.py::TestForServerBedework::testSetCalendarProperties - caldav.lib.error.NotFoundError: NotFoundError at '404 Not Found ERROR tests/test_caldav.py::TestForServerCCS::testSetCalendarProperties - caldav.lib.error.NotFoundError: NotFoundError at '404 Not Found ERROR tests/test_caldav.py::TestForServerSOGo::testSetCalendarProperties - caldav.lib.error.NotFoundError: NotFoundError at '404 Not Found in the master branch those two tests are broken: FAILED tests/test_caldav.py::TestForServerDavical::testRecurringDateWithExceptionSearch - KeyError: 'RECURRENCE-ID' FAILED tests/test_caldav.py::TestForServerCyrus::testRecurringDateWithExceptionSearch - KeyError: 'RECURRENCE-ID' ... and that's weird, because I'm pretty sure they passed before I pushed the changes and passed at github before I approved the pull request. please do some research claude-sonnet-4-6: Oh, "this branch" was meant to be async-github-testruns. I've checked it out now. claude-sonnet-4-6: Running the compatibility tests (which again runs code from ~/caldav-server-tester), I find this: For servers Xandikos, Stalwart: search.recurrences.expanded.exception found to be supported, compatibility matrix says it's not supported. Despite this, the compatibility test passes - why? The test should break when differences are found, except for if feature support is "fragile" or "unknown". claude-sonnet-4-6: please fix
1 parent 9f00439 commit 48e8e5c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

caldav/compatibility_hints.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,8 @@ def dotted_feature_set_list(self, compact=False):
907907
## Principal property search returns 403 (not implemented)
908908
"principal-search": "ungraceful",
909909

910-
## Server-side recurrence expansion for event exceptions is still broken;
911910
## VTODO RRULE expansion was fixed in xandikos PR #627 (released in 0.3.7).
912-
"search.recurrences.expanded.exception": "unsupported",
911+
## Exception expansion (CALDAV:expand with EXDATE/RECURRENCE-ID) is now also supported.
913912

914913
## Open-start time-range searches (no lower bound) crash xandikos 0.3.7 with a
915914
## 500 Internal Server Error (OverflowError: date value out of range in icalendar.py
@@ -1423,10 +1422,7 @@ def dotted_feature_set_list(self, compact=False):
14231422
## Stalwart returns the recurring todo in search results but doesn't return the
14241423
## RRULE intact, so client-side expansion can't expand it to specific occurrences.
14251424
'search.recurrences.includes-implicit.todo': {'support': 'fragile'},
1426-
## Stalwart doesn't handle exceptions properly in server-side CALDAV:expand:
1427-
## returns 3 items instead of 2 for a recurring event with one exception
1428-
## (the exception is stored as a separate object and returned twice).
1429-
'search.recurrences.expanded.exception': False,
1425+
## Stalwart correctly handles exceptions in server-side CALDAV:expand (observed supported).
14301426
## Stalwart stores master+exception VEVENTs as a single resource with 2 VEVENTs.
14311427
'save-load.event.recurrences.exception': {'support': 'full'},
14321428
'search.time-range.open': True,

tests/test_caldav.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,10 @@ def testCheckCompatibility(self, request) -> None:
15351535
fe = self.caldav.features
15361536

15371537
## dotted list expected and observed
1538+
## Snapshot checked features before compact=True calls collapse(), which
1539+
## mutates _server_features by removing subfeatures that collapse into
1540+
## their parent — making tested features look like untested ones.
1541+
checked_features = set(fo._server_features.keys())
15381542
observed = fo.dotted_feature_set_list(compact=True)
15391543
expected = fe.dotted_feature_set_list(compact=True)
15401544

@@ -1547,7 +1551,7 @@ def testCheckCompatibility(self, request) -> None:
15471551
continue
15481552
## Skip features the checker never explicitly tested -
15491553
## the observation would just be a default, not a real result
1550-
if feature not in observed and feature not in fo._server_features:
1554+
if feature not in observed and feature not in checked_features:
15511555
continue
15521556
type_ = fo.find_feature(feature).get("type", "server-feature")
15531557
if type_ in (

0 commit comments

Comments
 (0)