-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
MKCALENDAR: send VTIMEZONE in calendar-timezone #1044
MKCALENDAR: send VTIMEZONE in calendar-timezone #1044
Conversation
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Alright, now it's good: <?xml version="1.0" encoding="UTF-8"?>
<CAL:mkcalendar xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav">
<set>
<prop>
<resourcetype>
<collection/>
<CAL:calendar/>
</resourcetype>
<displayname>Calendar with timezone</displayname>
<CAL:calendar-description/>
<n0:calendar-color xmlns:n0="http://apple.com/ns/ical/">#B22222FF</n0:calendar-color>
<CAL:calendar-timezone-id>Africa/Algiers</CAL:calendar-timezone-id>
<CAL:calendar-timezone>BEGIN:VTIMEZONE
TZID:Africa/Algiers
LAST-MODIFIED:20240422T053450Z
TZURL:https://www.tzurl.org/zoneinfo/Africa/Algiers
X-LIC-LOCATION:Africa/Algiers
X-PROLEPTIC-TZNAME:LMT
BEGIN:STANDARD
TZNAME:PMT
TZOFFSETFROM:+001212
TZOFFSETTO:+000921
DTSTART:18910316T011444
END:STANDARD
BEGIN:STANDARD
TZNAME:WET
TZOFFSETFROM:+000921
TZOFFSETTO:+0000
DTSTART:19110311T010000
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:WEST
TZOFFSETFROM:+0000
TZOFFSETTO:+0100
DTSTART:19160615T000000
RDATE:19170325T000000
RDATE:19180310T000000
RDATE:19190302T000000
RDATE:19200215T000000
RDATE:19210315T000000
RDATE:19390912T000000
RDATE:19710425T230000
RDATE:19770506T000000
RDATE:19800425T000000
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:WET
TZOFFSETFROM:+0100
TZOFFSETTO:+0000
DTSTART:19161002T010000
RRULE:FREQ=YEARLY;UNTIL=19191005T230000Z;BYMONTH=10;BYMONTHDAY=2,3,4,5,6,7,8;BYDAY=MO
END:STANDARD
BEGIN:STANDARD
TZNAME:WET
TZOFFSETFROM:+0100
TZOFFSETTO:+0000
DTSTART:19201024T010000
RDATE:19210622T010000
RDATE:19391119T020000
RDATE:19461007T000000
RDATE:19630414T000000
RDATE:19710927T000000
RDATE:19791026T000000
RDATE:19801031T020000
END:STANDARD
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0000
TZOFFSETTO:+0100
DTSTART:19400225T030000
RDATE:19560129T000000
RDATE:19810501T000000
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19440403T020000
RRULE:FREQ=YEARLY;UNTIL=19450402T010000Z;BYMONTH=4;BYDAY=1MO
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19441008T020000
RDATE:19450916T010000
RDATE:19780922T030000
END:STANDARD
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0100
TZOFFSETTO:+0100
DTSTART:19771021T000000
END:STANDARD
BEGIN:DAYLIGHT
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19780324T010000
END:DAYLIGHT
END:VTIMEZONE
</CAL:calendar-timezone>
</prop>
</set>
</CAL:mkcalendar> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not check the code, but in your last example the VTIMEZONE
is not wrapped in an icalendar object VCALENDAR
as the standard says it should be.
From the spec on
calendar-timezone
https://www.rfc-editor.org/rfc/rfc4791#section-5.2.25.2.2. CALDAV:calendar-timezone Property Name: calendar-timezone ... "an iCalendar object with exactly one VTIMEZONE component.
See also the example in section 5.2.2.
Yup, my bad, I misread that. I'll update it asap |
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Okay, should be fixed now. <?xml version='1.0' encoding='UTF-8' ?>
<CAL:mkcalendar
xmlns="DAV:"
xmlns:CAL="urn:ietf:params:xml:ns:caldav"
xmlns:CARD="urn:ietf:params:xml:ns:carddav">
<set>
<prop>
<resourcetype>
<collection />
<CAL:calendar />
</resourcetype>
<displayname>Calendar with Timezone</displayname>
<CAL:calendar-description></CAL:calendar-description>
<n0:calendar-color
xmlns:n0="http://apple.com/ns/ical/">#DCDCDCFF
</n0:calendar-color>
<CAL:calendar-timezone-id>Africa/Asmera</CAL:calendar-timezone-id>
<CAL:calendar-timezone>BEGIN:VCALENDAR
BEGIN:VTIMEZONE
TZID:Africa/Asmera
BEGIN:STANDARD
TZNAME:+0230
TZOFFSETFROM:+022716
TZOFFSETTO:+0230
DTSTART:19080501T010000
END:STANDARD
BEGIN:STANDARD
TZNAME:EAT
TZOFFSETFROM:+0230
TZOFFSETTO:+0300
DTSTART:19280701T010000
END:STANDARD
BEGIN:STANDARD
TZNAME:+0230
TZOFFSETFROM:+0300
TZOFFSETTO:+0230
DTSTART:19300105T010000
END:STANDARD
BEGIN:STANDARD
TZNAME:+0245
TZOFFSETFROM:+0230
TZOFFSETTO:+0245
DTSTART:19370101T010000
END:STANDARD
BEGIN:STANDARD
TZNAME:EAT
TZOFFSETFROM:+0245
TZOFFSETTO:+0300
DTSTART:19420801T000000
END:STANDARD
END:VTIMEZONE
END:VCALENDAR
</CAL:calendar-timezone>
</prop>
</set>
</CAL:mkcalendar> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some time we should probably replace the timezone
in the DB by a timezoneId
, too.
app/src/main/kotlin/at/bitfire/davdroid/repository/DavCollectionRepository.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/repository/DavCollectionRepository.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/at/bitfire/davdroid/repository/DavCollectionRepository.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
We should do it on a separate PR then, no? |
Yes because it would also require a DB migration. Originally I wanted the |
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
816bcb2
to
e958378
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks correct!
However I have tried with Fastmail again (which was the original reason why the problem came up).
And while the new MKCALENDAR
request seems correct to me, Fastmail answers
<?xml version="1.0" encoding="utf-8"?>
<multistatus xmlns="DAV:" xmlns:CAL="urn:ietf:params:xml:ns:caldav" xmlns:CARD="urn:ietf:params:xml:ns:carddav" xmlns:n0="http://apple.com/ns/ical/">
<propstat>
<prop>
<CAL:calendar-timezone-id/>
</prop>
<status>HTTP/1.1 403 Forbidden</status>
</propstat>
<propstat>
<prop>
<resourcetype/>
<displayname/>
<CAL:calendar-description/>
<n0:calendar-color/>
<CAL:calendar-timezone/>
</prop>
<status>HTTP/1.1 424 Failed Dependency</status>
</propstat>
</multistatus>
Can you have a look at that? Is it maybe forbidden to set the calendar-timezone-id
or do we have some error? And does it work when
- only the
calendar-timezone
(this time correct), - or only the
calendar-timezone-id
is set, - and is the error even reproducible for you when you set both (as with the PR in its current condition)
…n-calendar-timezone' into 1031-mkcalendar-send-vtimezone-in-calendar-timezone
I have also tried creating a calendar with timezone, which generates the following: Request<?xml version='1.0' encoding='UTF-8' ?>
<CAL:mkcalendar
xmlns="DAV:"
xmlns:CAL="urn:ietf:params:xml:ns:caldav"
xmlns:CARD="urn:ietf:params:xml:ns:carddav">
<set>
<prop>
<resourcetype>
<collection />
<CAL:calendar />
</resourcetype>
<displayname>Calendar with timezone</displayname>
<CAL:calendar-description></CAL:calendar-description>
<n0:calendar-color
xmlns:n0="http://apple.com/ns/ical/">#FFFAFAFF
</n0:calendar-color>
<CAL:calendar-timezone-id>Africa/Bamako</CAL:calendar-timezone-id>
<CAL:calendar-timezone>BEGIN:VCALENDAR
BEGIN:VTIMEZONE
TZID:Africa/Bamako
BEGIN:STANDARD
TZNAME:GMT
TZOFFSETFROM:+001608
TZOFFSETTO:+0000
DTSTART:19120101T000000
END:STANDARD
END:VTIMEZONE
END:VCALENDAR
</CAL:calendar-timezone>
</prop>
</set>
</CAL:mkcalendar> but the answer is still Response<?xml version="1.0" encoding="utf-8"?>
<multistatus
xmlns="DAV:"
xmlns:CAL="urn:ietf:params:xml:ns:caldav"
xmlns:CARD="urn:ietf:params:xml:ns:carddav"
xmlns:n0="http://apple.com/ns/ical/">
<propstat>
<prop>
<CAL:calendar-timezone-id/>
</prop>
<status>HTTP/1.1 403 Forbidden</status>
</propstat>
<propstat>
<prop>
<resourcetype/>
<displayname/>
<CAL:calendar-description/>
<n0:calendar-color/>
<CAL:calendar-timezone/>
</prop>
<status>HTTP/1.1 424 Failed Dependency</status>
</propstat>
</multistatus> |
I've seen that fastmail doesn't support choosing a timezone for the calendar you are creating from the UI: Is it possible that this is simply not allowed? They are returning a 403, which may mean that the operation is forbidden, which would be pretty self-explanatory. I couldn't find any information on what features does Fastmail support or not support on CalDAV |
Does it work without time zone? If yes, we could also add a "no preferred timezone" option, or ask the Fastmail people again here: #860 (comment). I think it should work, otherwise we should Rob have anwerered with the details about the timezone definition? |
I've tried setting the default timezone to null (which displays as Request<?xml version='1.0' encoding='UTF-8' ?>
<CAL:mkcalendar
xmlns="DAV:"
xmlns:CAL="urn:ietf:params:xml:ns:caldav"
xmlns:CARD="urn:ietf:params:xml:ns:carddav">
<set>
<prop>
<resourcetype>
<collection />
<CAL:calendar />
</resourcetype>
<displayname>Calendar without timezone</displayname>
<CAL:calendar-description></CAL:calendar-description>
<n0:calendar-color
xmlns:n0="http://apple.com/ns/ical/">#DC143CFF
</n0:calendar-color>
</prop>
</set>
</CAL:mkcalendar> And it gets created correctly (returns 201 empty response). |
I'll ask Rob and see if he has anything to say |
For reference: #860 (reply in thread) |
So, shall we
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without calendar-timezone-id it works with Fastmail, right?
So I suggest to comment out the timezone-id for now and check again when we do #1052.
I'd just change the default value for timezone in the state of the viewmodel to null. Everything is handled already, it just won't set any timezone. Maybe adding a text below saying something like "if not set, will use the timezone of your server". It will be really strange that someone manually picks a timezone, since we don't have any search feature, so it's a bit inconvenient. Then, if someone actually uses it, it's up to the server to work or not. |
Hm… we don't use floating time at all, and it seems to be rarely used. The timezone is only used for floating time calculations (and even then only when the specific request doesn't set a timezone), so … agreed, let's
|
Signed-off-by: Arnau Mora Gras <arnyminerz@proton.me>
@rfc2822 Should be ready then |
Nice 👍🏻 |
Purpose
See #1031
Short description
CalendarTimezoneId
VTIMEZONE
usinggetVTimeZone
, and if successful, append asCalendarTimezone
Checklist