fix: (CalDav) Delete invitation link when deleting Calendars or Events#47832
fix: (CalDav) Delete invitation link when deleting Calendars or Events#47832SebastianKrupinski merged 1 commit intomasterfrom
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
tcitworld
left a comment
There was a problem hiding this comment.
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
st3iny
left a comment
There was a problem hiding this comment.
Tested and works. Code looks good, too.
|
/backport to stable30 |
|
/backport to stable29 |
|
/backport to stable28 |
ChristophWurst
left a comment
There was a problem hiding this comment.
Looks good!
Performance wise, we can optimize the query loop a bit
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
49d8762 to
4740c18
Compare
Summary
When deleting a calendar or event also delete event invitation links