mirror of
https://github.com/nextcloud/server.git
synced 2026-02-16 09:19:43 -05:00
fix(dav): catch MaxInstancesExceededException on calendar events
Signed-off-by: Luc Didry <luc@didry.org>
This commit is contained in:
parent
cea10d643e
commit
f83cebf79e
1 changed files with 31 additions and 16 deletions
|
|
@ -65,6 +65,7 @@ use Sabre\VObject\ParseException;
|
|||
use Sabre\VObject\Property;
|
||||
use Sabre\VObject\Reader;
|
||||
use Sabre\VObject\Recur\EventIterator;
|
||||
use Sabre\VObject\Recur\MaxInstancesExceededException;
|
||||
use Sabre\VObject\Recur\NoInstancesException;
|
||||
use function array_column;
|
||||
use function array_map;
|
||||
|
|
@ -1723,6 +1724,12 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
'exception' => $ex,
|
||||
]);
|
||||
continue;
|
||||
} catch (MaxInstancesExceededException $ex) {
|
||||
$this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [
|
||||
'app' => 'dav',
|
||||
'exception' => $ex,
|
||||
]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$matches) {
|
||||
|
|
@ -2072,24 +2079,32 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
continue;
|
||||
}
|
||||
|
||||
$isValid = $this->validateFilterForObject($row, [
|
||||
'name' => 'VCALENDAR',
|
||||
'comp-filters' => [
|
||||
[
|
||||
'name' => 'VEVENT',
|
||||
'comp-filters' => [],
|
||||
'prop-filters' => [],
|
||||
'is-not-defined' => false,
|
||||
'time-range' => [
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
try {
|
||||
$isValid = $this->validateFilterForObject($row, [
|
||||
'name' => 'VCALENDAR',
|
||||
'comp-filters' => [
|
||||
[
|
||||
'name' => 'VEVENT',
|
||||
'comp-filters' => [],
|
||||
'prop-filters' => [],
|
||||
'is-not-defined' => false,
|
||||
'time-range' => [
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'prop-filters' => [],
|
||||
'is-not-defined' => false,
|
||||
'time-range' => null,
|
||||
]);
|
||||
'prop-filters' => [],
|
||||
'is-not-defined' => false,
|
||||
'time-range' => null,
|
||||
]);
|
||||
} catch (MaxInstancesExceededException $ex) {
|
||||
$this->logger->warning('Caught max instances exceeded exception for calendar data. This usually indicates too much recurring (more than 3500) event in calendar data. Object uri: '.$row['uri'], [
|
||||
'app' => 'dav',
|
||||
'exception' => $ex,
|
||||
]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_resource($row['calendardata'])) {
|
||||
// Put the stream back to the beginning so it can be read another time
|
||||
|
|
|
|||
Loading…
Reference in a new issue