pimutils / pimutils/vdirsyncer

The way DAV figures out names of collections is wrong

Open
#405 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: RFCs lv: hard mod: DAV planning type: bug
Dominant language
Python
Stars
1.9k
Forks
185
Avg merge
11h 49m
Merged PRs (30d)
1

Description

Right now each collection has a "name" and a "displayname". They have distinctive properties:

  • The range of allowed characters is restricted for "name". This is not specified anywhere, but at least slashes and nullbytes are not allowed. In practice you might not be able to use anything else than [a-zA-Z0-9_-], depending on the DAV server.
  • The "name" must be unique among all collections for the user.
  • It should not be possible to change the "name" after creating the collection.

For filesystem-storage, the "name" is the directory name, and "displayname" is a file inside the directory.

For caldav/carddav, the "displayname" is just a value attached to the collection, and isn't really important. As per the RFC, collections are uniquely identified by URLs, but we don't use them for "name".

But since those URLs are not very pretty and contain slashes, we do something completely bizarre: We use the last path segment for identifying a collection. For most FOSS servers this provides us with a human-readable unique identifier, so at first sight it appeared perfect for use in "name".

Unfortunately, as per the RFC, the last path segment does neither have to be human-readable nor unique:

  • Apple's iCloud uses UUIDs in that segment, which are not human-readable.
  • For Google CalDAV, the last path segment is just the string events, the real (again a UUID, therefore not human-readable) identifier is in the previous one. So we have this behavior changed accordingly in the google storage types.

In the long run we should find a different way to generate "name" for the DAV-storages. I think, if ever, this should be done pre-1.0 as it will come with massive breakage for the user.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the filesystem, caldav/carddav, and google storage types named in the issue, and trace where collection names are derived from DAV URLs. Determine a stable, unique naming approach and the required pre-1.0 migration or compatibility work. Done requires an agreed design and an implementation plan that accounts for existing users.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.