Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/dav/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use OCA\DAV\CalDAV\CalDavBackend;
use OCA\DAV\CalDAV\CalendarManager;
use OCA\DAV\CalDAV\CalendarProvider;
use OCA\DAV\CalDAV\Reminder\Backend as ReminderBackend;
use OCA\DAV\CalDAV\Reminder\NotificationProvider\AudioProvider;
use OCA\DAV\CalDAV\Reminder\NotificationProvider\EmailProvider;
use OCA\DAV\CalDAV\Reminder\NotificationProvider\PushProvider;
Expand Down Expand Up @@ -306,6 +307,9 @@ function (GenericEvent $event) use ($container, $serverContainer) {
/** @var CalDavBackend $calDavBackend */
$calDavBackend = $container->query(CalDavBackend::class);
$calDavBackend->purgeAllCachedEventsForSubscription($subscriptionData['id']);
Copy link
Member Author

Choose a reason for hiding this comment

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

Notice that we don't call purgeAllCachedEventsForSubscription anymore in SubscriptionDeletionListener, as the event is dispatched after the deletion of related calendarobjects, calendarchanges and calendarobjects_props, so it doesn't make sense to call it again.

purgeAllCachedEventsForSubscription is used only when we refresh the data, so that we can addChanges.

/** @var ReminderBackend $calDavBackend */
$reminderBackend = $container->query(ReminderBackend::class);
$reminderBackend->cleanRemindersForCalendar($subscriptionData['id']);
}
);

Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/CalDAV/Reminder/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function getRemindersToProcess():array {
$query->select(['cr.*', 'co.calendardata', 'c.displayname', 'c.principaluri'])
->from('calendar_reminders', 'cr')
->where($query->expr()->lte('cr.notification_date', $query->createNamedParameter($this->timeFactory->getTime())))
->leftJoin('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id'))
->leftJoin('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'));
->join('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id'))
->join('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'));
$stmt = $query->execute();

return array_map(
Expand Down
8 changes: 8 additions & 0 deletions apps/dav/lib/CalDAV/Reminder/ReminderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public function processReminders():void {
? stream_get_contents($reminder['calendardata'])
: $reminder['calendardata'];

if (!$calendarData) {
continue;
}

$vcalendar = $this->parseCalendarData($calendarData);
if (!$vcalendar) {
$this->backend->removeReminder($reminder['id']);
Expand Down Expand Up @@ -168,6 +172,10 @@ public function onCalendarObjectCreate(array $objectData):void {
? stream_get_contents($objectData['calendardata'])
: $objectData['calendardata'];

if (!$calendarData) {
return;
}

/** @var VObject\Component\VCalendar $vcalendar */
$vcalendar = $this->parseCalendarData($calendarData);
if (!$vcalendar) {
Expand Down