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

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

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 <[email protected]>
@tcitworld tcitworld force-pushed the rename-deleted-default-calendar-in-trashbin branch from 74deaf1 to ef0e221 Compare January 6, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant