Skip to content

fix: tolerate an empty calendar-user-address-set - #716

Open
tobixen wants to merge 3 commits into
masterfrom
xandikos-empty-cuas
Open

tobixen wants to merge 3 commits into
masterfrom
xandikos-empty-cuas

Conversation

@tobixen

@tobixen tobixen commented Sep 20, 2026

Copy link
Copy Markdown
Member

Xandikos served us an empty calendar-user-address-set, the library responded by raising IndexError: list index out of range. RFC 6638 §2.4.1 has the URI of the principal resource stand in for a user with no well-defined calendar user address, so that fallback has now been made on the client side. The same fallback goes into change_attendee_status(). An absent property still raises NotFoundError.

The new compatibility feature scheduling.calendar-user-address-set.populated has been set to unsupported for Xandikos. scheduling and create-calenar.with-supported-component-types has been set to supported, as Xandikos 0.4.7 has added support.

🤖 Code (mostly) generated with Claude Code

Companion PR: python-caldav/caldav-server-tester#16 — the probe that measures the new feature.

Compatibility hints adjusted to match master version of xandikos.

Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
get_vcal_address() indexed the address list blindly, so a server that
advertises the property and returns it empty produced `IndexError: list
index out of range` out of a public API - and out of add_organizer()
and add_attendee(), which go through it.  RFC 6638 section 2.4.1 covers
this: a user with no well-defined calendar user address is identified
by the URI of his principal resource, and that is what the sync and
async variants now fall back to.  An absent property still raises
NotFoundError, which the same section defines as not enabled for
scheduling.  Xandikos 0.4.7 is such a server, and gets the new
scheduling.calendar-user-address-set.populated feature graded
unsupported rather than a weakened assert in testAddOrganizer.

The same fallback goes into change_attendee_status(), which resolves an
attendee through the address set too: without it the library invited a
principal to an event it could then not update.

Prompt: I've checked out master and adjusted the compatibility hints so that the compatibility check passes with the master version of xandikos.  `pytest -k xandikos` still gives failures. Please investigate. (sic) (four IndexError test failures pasted)
Followup-Prompt: [fix this with a] new feature flag for the xandikos problem

Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
caldav/config.py optionally imports tests.test_servers.registry to
auto-start a test server when run from a source checkout, falling
back gracefully via ImportError otherwise. deptry's isolated CI
install doesn't ship tests/, so it flagged the import as missing,
which was also breaking this PR's deptry check independently of its
own change.

Prompt: Add fix as another commit onto PR 716, after all the purpose of PR 716 is to get the tests green again
Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant