nextcloud / nextcloud/server

[Bug]: [CalDAV] `CALDAV:schedule-default-calendar-URL` is set on the principal instead of the scheduling inbox

Open
#57,883 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 32-feedback bug feature: caldav
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

I have noticed that on our testing instance that we use to test Nextcloud integration with DAVx5, the CALDAV:schedule-default-calendar-URL is set on the principal, but not on the scheduling inbox, as required by RFC 6638: Default Calendar Collection:

The CALDAV:schedule-default-calendar-URL WebDAV property, which can be present on the scheduling Inbox collection of a calendar user, specifies whether this calendar user has a default calendar collection.

And in section 9.2:

This property MAY be defined on a scheduling Inbox collection.

So the property should at least be defined on the scheduling inbox collection.

Steps to reproduce

Contents of propfind.xml:

<?xml version="1.0" encoding="utf-8"?>
<D:propfind xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
  <D:prop>
    <D:current-user-principal/>
    <C:schedule-inbox-URL/>
    <C:schedule-default-calendar-URL/>
  </D:prop>
</D:propfind>

Step 1: Find principal URL over current-user-principal.

curl -u test:password -X PROPFIND --data @propfind.xml -H 'Depth: 0' https://nextcloud/remote.php/dav/ | xmllint --format -

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/</d:href>
    <d:propstat>
      <d:prop>
        <d:current-user-principal>
          <d:href>/remote.php/dav/principals/users/test/</d:href>
        </d:current-user-principal>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    ...
  </d:response>
</d:multistatus>

Step 2: Query principal URL for scheduling inbox URL:

$ curl -u test:password -X PROPFIND --data @propfind.xml -H 'Depth: 0' https://nextcloud/remote.php/dav/principals/users/test/ | xmllint --format -

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/principals/users/test/</d:href>
    <d:propstat>
      <d:prop>
        ...
        <cal:schedule-inbox-URL>
          <d:href>/remote.php/dav/calendars/test/inbox/</d:href>
        </cal:schedule-inbox-URL>
        <cal:schedule-default-calendar-URL>
          <d:href>/remote.php/dav/calendars/test/personal/</d:href>
        </cal:schedule-default-calendar-URL>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

→ the scheduling inbox URL is /remote.php/dav/calendars/test/inbox/.

(Note that there's already a schedule-default-calendar-URL set for the principal.)

Step 3: Query the scheduling inbox for the default calendar

$ curl -u test:password -X PROPFIND --data @propfind.xml -H 'Depth: 0' https://nextcloud/remote.php/dav/calendars/test/inbox/ | xmllint --format -

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/calendars/test/inbox/</d:href>
    ...
    <d:propstat>
      <d:prop>
        <cal:schedule-inbox-URL/>
        <cal:schedule-default-calendar-URL/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

→ On the scheduling inbox, schedule-default-calendar-URL is not set, although it should be.

Expected behavior

The schedule-default-calendar-URL property should be set on the scheduling inbox.

Nextcloud Server version

32

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

Found that when trying to implement the standards-compliant "Find default calendar of user" operation for https://github.com/bitfireAT/davx5-ose/pull/1945.

Other compliant CalDAV clients will also look for the property of the inbox, not on the principal.

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

Start by tracing the PROPFIND handling for the principal and scheduling inbox URLs described in the reproduction, focusing on the CALDAV:schedule-default-calendar-URL property. Compare the responses with RFC 6638 sections 4.3 and 9.2. Done means the property is returned on /remote.php/dav/calendars/test/inbox/ as well as meeting the reported expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.