Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caldav: add support for more props on MKCOL and PROPFIND #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DeepDiver1975
Copy link
Contributor

@DeepDiver1975 DeepDiver1975 commented Feb 22, 2024

Todo:

  • add support for these props on PROPFIND
  • build the same for CardDAV MKCOL

@DeepDiver1975
Copy link
Contributor Author

@emersion please review

@DeepDiver1975 DeepDiver1975 force-pushed the feat/create-calendar-props branch from 36d2981 to c2ad716 Compare February 22, 2024 22:03
@DeepDiver1975 DeepDiver1975 changed the title fix: add support for more props on CalDAV MKCOL feat: add support for more props on CalDAV MKCOL and PROPFIND on calendars Feb 22, 2024
@DeepDiver1975
Copy link
Contributor Author

@emersion how can we get this moving? THX

"fmt"
"github.com/emersion/go-webdav/internal"
"github.com/stretchr/testify/assert"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to not add the testify dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testify allows to write a bit more compact test code.
Which improves readability.

Copy link
Owner

@emersion emersion Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a whole new library to learn. I prefer to write tests like the Go standard library does. Also, compact ≠ readable (quite the contrary in general).

calendarName = xml.Name{namespace, "calendar"}
calendarDataName = xml.Name{namespace, "calendar-data"}
calendarColorName = xml.Name{
Space: "http://apple.com/ns/ical/",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The standard way to set the color of a calendar is: https://datatracker.ietf.org/doc/html/rfc7986#section-5.9

This is a non-standard, Apple-specfic property. I'm not sure I want to support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never saw this one in real life. But happy to add this as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding my 2 cents: I have indeed also observed the proliferation of this pseudo-standard (apple.com/ns/ical) into many open-source clients (e.g. DavX5 sets it on MKCOL). On the other hand, from my experience, after initial calendar creation, this is treated as a pure client-side property by pretty much all clients (i.e. it never gets updated again), so not sure how necessary it really is...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so not sure how necessary it really is...

agreed - this is for sure a pretty low feature.
Never the less if the color is stored server side it will be "synced" once opening the calendar with another client which has some benefits of recognizing calendars.

e.g. on the owncloud 10 codebase (php+sabredav) colors are the same on all clients (owncloud calendar app in web, DAVx and iOS)

Copy link
Owner

@emersion emersion Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, actually it doesn't seem like there is any standard way to fetch a VCALENDAR for the calendar itself in CalDAV. So RFC 7986 is only useful to set the calendar color when exporting a whole calendar as .ics.

Oh well, let's just do like everybody else then…

DisplayName string `xml:"set>prop>displayname"`
Description string `xml:"set>prop>calendar-description"`
CalendarColor string `xml:"set>prop>calendar-color"`
CalemdarTimeZone string `xml:"set>prop>calendar-timezone"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "Calendar"

@emersion
Copy link
Owner

Some more general notes:

  • Please try to keep 1 commit (or 1 pull request) per separate feature
  • We don't use the "feat:" commit prefix, instead we prefix commit messages by the name of the Go package involved.

@DeepDiver1975 DeepDiver1975 force-pushed the feat/create-calendar-props branch from 89545b3 to 46d5e86 Compare April 9, 2024 10:54
@DeepDiver1975 DeepDiver1975 changed the title feat: add support for more props on CalDAV MKCOL and PROPFIND on calendars caldav: add support for more props on MKCOL and PROPFIND Apr 9, 2024
@DeepDiver1975 DeepDiver1975 force-pushed the feat/create-calendar-props branch from 46d5e86 to 96422a0 Compare April 9, 2024 10:57
@DeepDiver1975 DeepDiver1975 force-pushed the feat/create-calendar-props branch from 96422a0 to ab37619 Compare April 9, 2024 11:25
@DeepDiver1975
Copy link
Contributor Author

@emersion @bitfehler please review again - did not yet change the color prop name ... as explained above this is the property I see in real life .... 🤷

ResourceType internal.ResourceType `xml:"set>prop>resourcetype"`
DisplayName string `xml:"set>prop>displayname"`
Description string `xml:"set>prop>calendar-description"`
CalendarColor string `xml:"set>prop>calendar-color"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably specify the http://apple.com/ns/ical/ namespace for this prop?

MaxResourceSize int64
SupportedComponentSet []string
Timezone string
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a parsed *ical.Calendar?

We should probably check that the parsed value contains exactly one VTIMEZONE component?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants