Skip to content

fix: handle undeclared XML namespace prefixes in PROPFIND responses#79

Open
stephan1827 wants to merge 1 commit into
nextcloud:mainfrom
stephan1827:fix/xml-namespace-prefixes
Open

fix: handle undeclared XML namespace prefixes in PROPFIND responses#79
stephan1827 wants to merge 1 commit into
nextcloud:mainfrom
stephan1827:fix/xml-namespace-prefixes

Conversation

@stephan1827

Copy link
Copy Markdown
Contributor

Summary

  • Fastmail (Cyrus IMAP backend) includes proprietary elements such as CY:write-properties-resource in CalDAV PROPFIND responses without declaring the CY namespace prefix.
  • This causes Sabre's strict XML parser to throw a LibXMLException before any standard DAV properties can be extracted, breaking harmonization for all Fastmail-hosted calendars and address books.
  • On ParseException, the fix collects all undeclared namespace prefixes from the response XML, injects placeholder URN declarations into the root element, then retries parsing. The placeholder namespaces are ignored by the harmonization logic since only well-known DAV/CalDAV/CardDAV properties are consumed.

Test plan

  • Connect a Fastmail (or other Cyrus IMAP) account
  • Trigger harmonization and verify calendars and contacts sync without XML parse errors in the log

@stephan1827 stephan1827 force-pushed the fix/xml-namespace-prefixes branch from 33404bd to eaa85cf Compare June 25, 2026 19:00
Fastmail (Cyrus IMAP backend) includes proprietary elements such as
CY:write-properties-resource in CalDAV PROPFIND responses without
declaring the CY namespace prefix. This causes Sabre's strict XML
parser to throw a LibXMLException before any standard DAV properties
can be extracted.

On ParseException, collect all namespace prefixes used in the response
XML that have no corresponding xmlns declaration, inject placeholder
URN declarations into the root element, then retry parsing. The
placeholder namespaces are ignored by the harmonization logic since
only well-known DAV/CalDAV/CardDAV properties are consumed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: stephan1827 <stephan@stricker.cloud>
@stephan1827 stephan1827 force-pushed the fix/xml-namespace-prefixes branch from eaa85cf to 1766dd7 Compare June 26, 2026 11:51
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