Open Bug 1873834 Opened 9 months ago Updated 9 months ago

Unable to move an event from one CalDav Calendar to another using the same provider

Categories

(Calendar :: Provider: CalDAV, defect)

Thunderbird 115
defect

Tracking

(Not tracked)

People

(Reporter: a.polivanchuk, Assigned: Bogomil)

Details

Steps to reproduce:

  • Create a new event and save it in Calendar 1.
  • Edit saved event - switch to Calendar 2 and save.
  • The event is still saved in Calendar 1.
    Both calendars are connected via CalDav.
    I'm unsure whether this option worked before, but it definitely should.

What is your CalDav provider? Do you receive any errors while attempting to change it?

Flags: needinfo?(artem)

I use Fastmail.
Any other changes in the calendar events are successfully saved and reflected.
I also tried force sync after switching the event from Calendar 1 to Calendar 2 without success.

Flags: needinfo?(artem)

I tried with Google CalDav and I was able to change it. It took 2-3 seconds to do the operations, but it worked

Can you reach out to Fastmail support and see if there is something connected to them. I don't have a fast mail account and cannot reproduce it

(In reply to Bogomil Shopov[:Bogomil] from comment #4)
Same with mailbox.org
Calendar: CalDAV: Unexpected status adding item to mailbox (Important Events): 403 CalDavCalendar.jsm:635

(In reply to Artem Polivanchuk from comment #2)
In your developper console from the help menu in thunderbird, do you see a 403 error?

Component: General → Provider: CalDAV
Product: Thunderbird → Calendar
Version: unspecified → Thunderbird 115

Could that be on the CalDAV side - wrong permissions on the calendar itself

Looking at the source code https://hg.mozilla.org/comm-central/file/038f9fd59eb4481efb8526abe84a7f8e41629082/calendar/providers/caldav/CalDavCalendar.jsm this is an error from the provider and it's access forbidden, so I guess it's a permission violation from your end. How do you authenticate?

Flags: needinfo?(artem)

So I was able to reproduce it.

Test case:

  • Created two calendars on mailbox.org (trial account)
  • Added them separately as new calendars (they were discovered and displayed okay)
  • Created event in Calendar one
  • Tried to move to event to the Calendar Two
  • Operation failed got 403 error in the network console

Request

PUT /caldav/Y2FsOi8vMC80Mw/4a8ae8ac-1d74-4c2b-9eb5-ff2c9b2dfec8.ics HTTP/1.1
Host: dav.mailbox.org
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:115.0) Gecko/20100101 Thunderbird/115.6.0
Accept: text/xml
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Accept-Charset: utf-8,*;q=0.1
Content-Type: text/calendar; charset=utf-8
Content-Length: 854
If-None-Match: *
Origin: https://dav.mailbox.org
Authorization: Basic Ym***0BtYWlsYm94Lm9yZzp2U2s1aGczQA==
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
Pragma: no-cache
Cache-Control: no-cache


BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Prague
TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Prague
X-LIC-LOCATION:Europe/Prague
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20240111T085713Z
LAST-MODIFIED:20240111T090030Z
DTSTAMP:20240111T090030Z
UID:4a8ae8ac-1d74-4c2b-9eb5-ff2c9b2dfec8
SUMMARY:Event Uno
DTSTART;TZID=Europe/Prague:20240112T111500
DTEND;TZID=Europe/Prague:20240112T121500
CLASS:PUBLIC
DESCRIPTION:mqkakakakak
SEQUENCE:0
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

Response:

HTTP/1.1 403 Forbidden
Date: Thu, 11 Jan 2024 09:00:30 GMT
Server: Openexchange WebDAV
X-Robots-Tag: none
Content-Type: text/xml; charset=UTF-8
Strict-Transport-Security: max-age=15768000
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked

<D:error xmlns:D="DAV:">
  <no-uid-conflict xmlns="urn:ietf:params:xml:ns:caldav" />
</D:error>

And the error description is:

(CALDAV

no-uid-conflict) request, or targeted by a COPY or MOVE request, MUST NOT specify an iCalendar UID property value already in use in the targeted calendar collection or overwrite an existing calendar object resource with one that has a different UID property value. Servers SHOULD report the URL of the resource that is already making use of the same UID property value in the DAV:href element;

So if the both calendars belong to the same user/provider and it's CalDav, this error would happen. Not sure what could be the solution, but I can digg more if needed. At mailbox.org there is an issue already reported: https://userforum.mailbox.org/topic/6317-caldav-termin-lasst-sich-nicht-verschieben

The solution could be:

  1. use a new UID and save it the the new calendr via PUT then use DELETE with the old UID to remove the original event
    or 2) use MOVE instead of PUT if this the provider is the same. (I assume this will require more complex approach)
Summary: Switching calendars for event → Unable to move an event from one CalDav Calendar to another using the same provider

I'll investigate more and create a patch

Assignee: nobody → bogomil

Thanks a lot for the help Bogomil, there is no rush and it is not a high priority at least for me, but it was worth mentioning this situation as it can lead to inconvenient situations like :
-You check your calendar on your cellphone and you think that you do not have an event that day because the event was not placed in the right calendar.

I happened to find another kind of inconvenient situation with the calendar :
It is the fact that you cannot set a default calendar in Thunderbird for event.
It selects indeed the last selected calendar for events but if you forget to change the calendar you may think that your event is in the right calendar when it is not and then you may miss your event once on your phone in your daily life.
I opened another thread about this
https://bugzilla.mozilla.org/show_bug.cgi?id=1873770

(In reply to Bogomil Shopov[:Bogomil] from comment #7)

Looking at the source code https://hg.mozilla.org/comm-central/file/038f9fd59eb4481efb8526abe84a7f8e41629082/calendar/providers/caldav/CalDavCalendar.jsm this is an error from the provider and it's access forbidden, so I guess it's a permission violation from your end. How do you authenticate?

Since Thunderbird 115 Fastmail uses 0auth authentication and I connected using this method.

Flags: needinfo?(artem)

Thank you, Bogomil, for your proactive investigation of my report.
Obviously, there are CalDav providers (like Fastmail and Mailbox) which have this issue and I believe it can be managed on the Thunderbird client side for proper user experience.

You need to log in before you can comment on or make changes to this bug.