-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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) Delete invitation link when deleting Calendars or Events #47832
Conversation
* | ||
* @param int $calendarId | ||
*/ | ||
protected function purgeCalendarInvitations(int $calendarId) { |
Check notice
Code scanning / Psalm
MissingReturnType
* | ||
* @param string $eventId UID of the event | ||
*/ | ||
protected function purgeObjectInvitations(string $eventId) { |
Check notice
Code scanning / Psalm
MissingReturnType
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.
We also need a repair step to purge all entries in calendar_invitations
which don't match existing calendar objects.
Set the expiration date for those outdated links to in the past, and the CleanupInvitationTokenJob will take care of it. It will probably need modifications like server/apps/dav/lib/BackgroundJob/DeleteOutdatedSchedulingObjects.php Lines 30 to 34 in af6de04
as to not completely crash an instance until all outdated links are deleted. Would be a good idea to get some data from our instance too to see how many of these links exist in our database. Please ask the sysadmins to run a query for you. |
In my production instance, with ~22k rows in select count(i.id) from oc_calendar_invitations i left join oc_calendarobjects o on i.uid = o.uid where o.id is null; |
22M rows! wow. Can you tell how many calendar object the biggest calendar has? |
51k objects |
dec06cc
to
692d0e9
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.
Tested and works. Code looks good, too.
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
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.
Looks good!
Performance wise, we can optimize the query loop a bit
Signed-off-by: SebastianKrupinski <[email protected]>
49d8762
to
4740c18
Compare
Summary
When deleting a calendar or event also delete event invitation links