Radicale
Radicale copied to clipboard
Calendar update creates complete new calendar with same url
Hello, I have a collection (Radicale running on a Debian Server) root@server# pwd /var/lib/radicale/collections/collection-root/testuser root@server# ls -ldi 6579* 45884007 drwxr-x--- 3 radicale radicale 4096 Jul 25 14:36 65791233-cf20-7436-8baa-b13eddd5f14e root@server# ls -li 6579* 45884070 -rw------- 1 radicale radicale 349 Jul 25 14:36 1c8f4e50-1981-62b8-cc61-2047c40538d2.ics 45884053 -rw------- 1 radicale radicale 284 Jul 25 14:32 c1043f76-4039-415f-9d94-941498130824.ics
This is the calendar I am working with. I have included it in thunderbird. If I change an event in this calendar, synching it an look at the inodes again: root@server# ls -ldi 6579* 45884007 drwxr-x--- 3 radicale radicale 4096 Jul 25 14:40 65791233-cf20-7436-8baa-b13eddd5f14e root@server# ls -li 6579* 45884124 -rw------- 1 radicale radicale 349 Jul 25 14:40 1c8f4e50-1981-62b8-cc61-2047c40538d2.ics 45884053 -rw------- 1 radicale radicale 284 Jul 25 14:32 c1043f76-4039-415f-9d94-941498130824.ics
Only the directory and the first event is changed, but the inods are the same. The calendar and the event is updated.
I want to do the same now with an c# WebDavClient. I have a CalDav-library which is not relevant. With the help of this library, I create the following string, which will be sent to the server:
Console.WriteLine("my serialized calendar: " + serializedCalendar);
(gives the following output)
BEGIN:VCALENDAR PRODID:-//github.com/rianjs/ical.net//NONSGML ical.net 4.0//EN VERSION:2.0 BEGIN:VEVENT CREATED:20220712T113009Z DTEND:20220726T043000 DTSTAMP:20220725T123205Z DTSTART:20220726T033000 SEQUENCE:0 SUMMARY:Test5 UID:f8267df0-f3ff-4972-9999-cfc59fe3aa3d END:VEVENT BEGIN:VEVENT CREATED:20220721T161715Z DTEND:20220727T060000 DTSTAMP:20220725T123205Z DTSTART:20220727T050000 SEQUENCE:0 SUMMARY:TestA UID:0373f7c1-9778-46d1-9251-e278fc723b56 END:VEVENT END:VCALENDAR
Console.WriteLine(CalendarUri); // gives:
/testuser/65791233-cf20-7436-8baa-b13eddd5f14e/
byte[] bytes = Encoding.UTF8.GetBytes(serializedCalendar);
MemoryStream stream = new MemoryStream(bytes);
var responseCalendar = await WebDavClient.PutFile(CalendarUri, stream);
Console.WriteLine("responseCalendar: " + JsonConvert.SerializeObject(responseCalendar, Formatting.Indented));
(gives the following)
responseCalendar: { "StatusCode": 201, "Description": "Created", "IsSuccessful": true }
And the same as on top of this posting:
root@server# ls -ldi 6579* 41418756 drwxr-x--- 3 radicale radicale 4096 Jul 25 14:50 65791233-cf20-7436-8baa-b13eddd5f14e root@server# ls -li 6579* 41428972 -rw------- 1 radicale radicale 284 Jul 25 14:50 560219b6-c733-506d-580d-a6f0a7acbe78.ics 41428969 -rw------- 1 radicale radicale 284 Jul 25 14:50 e590b26c-16cd-a86f-aa4c-764839dee052.ics
The inode of the directory changed, what means it was created new. And so the events are completely new.
What have I to do, to get the calendar updated and not created new?