Skip to content

CardDAV: an addressbook-query without <C:filter> matches every object - #33

Merged
gnacho merged 1 commit into
mainfrom
fix/carddav-query-no-filter
Oct 17, 2026
Merged

gnacho merged 1 commit into
mainfrom
fix/carddav-query-no-filter

Conversation

@gnacho

@gnacho gnacho commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Closes #32.

Found in production: opencloud-contacts lists the address book with a REPORT addressbook-query that has no <C:filter> element (just getetag + address-data), the RFC 6352 give-me-everything form. go-webdav v0.7's carddav.Match falls through its empty prop-filters loop to return false, nil, so every object was discarded and the multistatus came back empty. Writes worked fine; the list was what came back empty, which read as 'contacts are not saved'.

QueryAddressObjects now handles the filterless query itself (every object matches, limit respected) and keeps delegating filtered queries to the library's Match, where a match error skips the object instead of failing the whole report.

Regression test drives the exact report the extension sends (two cards back with address-data; filtered query returns only the match). 38 tests green.

Found in production: opencloud-contacts lists the address book with a
REPORT addressbook-query that has no <C:filter> element (just getetag +
address-data), the RFC 6352 give-me-everything form. go-webdav v0.7's
carddav.Match falls through its empty prop-filters loop to
'return false, nil', so every object was discarded and the multistatus
came back empty. Writes worked fine; the list was what came back empty,
which read as 'contacts are not saved'.

QueryAddressObjects now handles the filterless query itself (every
object matches, result limit respected) and keeps delegating filtered
queries to the library's Match, where a match error skips the object
instead of failing the whole report.

The regression test drives the exact report the extension sends: two
stored cards come back with their address-data, and a filtered query
still returns only the matching card.

Closes #32
@gnacho
gnacho merged commit 27ed64a into main Oct 17, 2026
4 checks passed
@gnacho
gnacho deleted the fix/carddav-query-no-filter branch October 17, 2026 08:55
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.

CardDAV addressbook-query without <C:filter> returns an empty multistatus

2 participants