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

fix(caldav): rename default calendar to keep it in the trashbin instead of purging it #50034

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

tcitworld
Copy link
Member

@tcitworld tcitworld commented Jan 3, 2025

Summary

When doing a PROPFIND on default-calendar-url, if the current default calendar (fallbacking on personal uri) is in the trashbin, it's being purged so that it's recreated.

This leads to loss of data.

We can simply rename the calendar URI and add a suffix so that it doesn't conflict with the new calendar being created.
Shares are fine because they reference the resourceid and not the calendar URI.

TODO

  • Add random string or timestamp at the end of the suffix to make sure the new URI is unique
  • Find a workaround about moveCalendar not in Sabre\CalDAV\Backend\BackendInterface

Checklist

@tcitworld tcitworld added the 3. to review Waiting for reviews label Jan 3, 2025
@tcitworld tcitworld added this to the Nextcloud 31 milestone Jan 3, 2025
@tcitworld tcitworld requested a review from st3iny as a code owner January 3, 2025 19:17
@tcitworld
Copy link
Member Author

/backport to stable30

@tcitworld
Copy link
Member Author

/backport to stable29

@tcitworld tcitworld force-pushed the rename-deleted-default-calendar-in-trashbin branch 2 times, most recently from 5c28c3a to 74deaf1 Compare January 3, 2025 19:29
…ad of purging it

When doing a PROPFIND on default-calendar-url, if the current default calendar (fallbacking on personal uri)
is in the trashbin, it's being purged so that it's recreated.

This leads to loss of data.

We can simply rename the calendar URI and add a unique suffix so that it doesn't conflict with the new calendar
being created.
Shares are fine because they reference the resourceid and not the calendar URI.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
@tcitworld tcitworld force-pushed the rename-deleted-default-calendar-in-trashbin branch from 74deaf1 to ef0e221 Compare January 6, 2025 10:45
@ChristophWurst ChristophWurst removed the request for review from miaulalala January 8, 2025 12:33
@blizzz blizzz mentioned this pull request Jan 8, 2025
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. We should get this in for 31.

@st3iny st3iny added bug 4. to release Ready to be released and/or waiting for tests to finish feature: caldav Related to CalDAV internals and removed 3. to review Waiting for reviews labels Jan 11, 2025
@st3iny st3iny merged commit f0702ad into master Jan 11, 2025
188 checks passed
@st3iny st3iny deleted the rename-deleted-default-calendar-in-trashbin branch January 11, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: caldav Related to CalDAV internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants