Skip to content

save(no_overwrite=True): a UID found by the fallback search is a plain ConsistencyError #806

Closed

Description

@tobixen

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5, from the prompt:

yes [to drafting caldav issues for two findings of the calendaring 2.1 code review]


When the server enforces the UID precondition itself, a clash on save(no_overwrite=True) raises UidConflictConsistencyError (#756, #802). When caldav has to search for the UID first instead, it raises a plain ConsistencyError("no_overwrite flag was set, but object already exists") from _validate_save_constraints(). That happens whenever save.no-uid-conflict is not full, which includes every server without hints. The plain ConsistencyError is the same exception as for "the URL is taken" (If-None-Match: * failed).

So a caller cannot tell "another object holds this UID" from "something is already stored at this name". The answer differs only by server, not by what happened. calendaring reports which one was taken (AlreadyExistsError.taken), and currently guesses wrong on those servers.

Suggested fix: in _validate_save_constraints(), raise UidConflictConsistencyError when the object found lives at a different URL than self.url, and keep ConsistencyError when it is the same resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions