Skip to content

Move and rename on servers that keep a UID in one calendar, or rename a calendar's URL - #42

Closed
tobixen wants to merge 2 commits into
test/caldav-testing-registryfrom
fix/caldav-move-rename
Closed

tobixen wants to merge 2 commits into
test/caldav-testing-registryfrom
fix/caldav-move-rename

Conversation

@tobixen

@tobixen tobixen commented Oct 30, 2026

Copy link
Copy Markdown
Member

Disclaimer: AI-generated code and text below the line, generated by Claude Opus 5.5, from the prompt(s):

How to get move and rename to work on e.g. zimbra?
File an issue at the caldav repo about adding a move() that uses WebDAV MOVE when it's supported by the server. (...) Make the cheaper workaround as for now. Fix the rename. There are the compatibility hints "save-load.reuse-deleted-uid" and "save.duplicate-uid.cross-calendar" to consider too. If none of them are allowed, then it's impossible to move an event. If the latter is not allowed, it's needed to first delete then insert.


Stacked on #38 (test/caldav-testing-registry); retarget to main once that is merged.

Moving an item between calendars and renaming a calendar failed on several CalDAV servers:

Tested: the unit suite, and the move and rename scenario and conformance tests against Zimbra, Ox, Cyrus, SOGo, a second Zimbra account and Baikal. No news fragment: move and rename on CalDAV are not released yet, so this PR gets the skip-changelog label.

🤖 Generated with Claude Code

Several servers keep a UID in one calendar only, so add-then-delete
fails: CCS, Cyrus and Ox refuse the copy, and on Zimbra saving the
copy moves the original, so the delete gets a 404.  The move
capability now carries an order from save.duplicate-uid.cross-calendar:
delete-first (putting the item back if the add fails, and saying so if
that fails too; never for an occurrence), or add-may-move (the copy is
read back first; a 404 on the delete then means it moved the original).
Where delete-first would need a deleted UID to be reused and it cannot
be, move is unsupported.  A stopgap until caldav has a move() using
WebDAV MOVE:
python-caldav/caldav#841

Prompt: File an issue at the caldav repo about adding a move() that uses WebDAV MOVE when it's supported by the server.  File an issue to the caldav-server-repo (sic) project that it's needed with probes for the WebDAV MOVE and for the "copy is move"-behaviour.  Make the cheaper workaround as for now.  Fix the rename.  There are the compatibility hints "save-load.reuse-deleted-uid" and "save.duplicate-uid.cross-calendar" to consider too.  If none of them are allowed, then it's impossible to move an event.  If the latter is not allowed, it's needed to first delete then insert.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
Zimbra names a calendar's URL after its display name, so renaming it
moves the calendar, and looking it up by its old id failed.  After a
rename, set_name() lists the calendars, and where the old URL is gone
and one calendar has the new name, takes it and updates url and id;
with several of that name it does not guess.  This costs one listing
per rename on every server; no hint says which servers do this.

Prompt: (same as the previous commit) ... Fix the rename. ...

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
@tobixen tobixen added the skip-changelog No changelog fragment needed label Oct 30, 2026
tobixen added a commit that referenced this pull request Oct 30, 2026
…ar, or rename a calendar's URL

#42

Moving an item works where a server keeps a UID in one calendar only
(CCS, Cyrus, Ox: delete first, never for an occurrence, and not at all
where a deleted UID cannot be reused; Zimbra: the copy moves the
original), from caldav's hints, until caldav has a move() using WebDAV
MOVE.  A rename that moves the calendar's URL (Zimbra) is followed.

Commits:
- ffc45d9 fix: move where a UID fits in one calendar only
- 75db9dc fix: follow a calendar that a rename moved

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
@tobixen

tobixen commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

AI-generated comment (Claude Opus 5.5). Merged into main as 0a0d112 (merge train with #38). GitHub cannot mark it merged, as its base was #38's branch, which does not contain these commits.

@tobixen tobixen closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog No changelog fragment needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant