Contacts: a REV in the extended form vCard 3 uses is not read, so the phone wins every both-sides conflict #25
Labels
No labels
bug
documentation
enhancement
performance
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-dav#25
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo-dav at
97abc9779, reading the vCard timestamp parser and running it on sample cards.parse_stampaccepts only the basic formYYYYMMDDTHHMMSSZ. RFC 2426, the vCard 3 specification, gives REV in the extended form (REV:1995-10-31T22:27:10Z), and so do clients that write vCard 3. Such a REV is read asNone, and the conflict rule then treats the phone's card as changed "now", which is always later than the local edit. The later change does not win, as the README and the module docstring promise; the phone's does.src/postulo_dav/text.py:270-283(_STAMP = re.compile(r"^(\d{4})(\d{2})(\d{2})(?:T(\d{2})(\d{2})(\d{2}))?(Z?)$")andparse_stamp);src/postulo_dav/sync.py:472(if local_changed and (incoming.rev or now) < contact.updated_at:).text.text_to_card("BEGIN:VCARD\r\nREV:2026-09-06T10:00:00Z\r\nEND:VCARD").revisNone(checked by running it), while the basic form parses. A contact edited on the phone at 10:00, with REV in the extended form, and edited here at 10:10, is overwritten by the phone's card at the 10:15 run; the local version survives only as a "Changed here on …" paragraph in the notes.parse_stamp. When REV is still unreadable, say in the report that the winner was chosen without the phone's time, rather than silently assuming "now".Done when
tests/test_dav.pythatREV:2026-09-06T10:00:00ZandREV:2026-09-06T12:00:00+02:00both read as 10:00 UTC, and a sync test where a card with an older extended-form REV loses to a later local edit.Fixed by pull request #35, merged as
fb8bbd7ae.