aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-09-16 15:04:49 +0200
committerGitHub <noreply@github.com>2024-09-16 15:04:49 +0200
commitcfed24cb0254caf570b2a520979a83435a677cc8 (patch)
tree6903358a945c2f290b82f020231a54188cb8a217 /apps/dav/lib
parentdc8a8bea97c7f9be1465b1445552f58c91f19632 (diff)
parent615f0b2c0e5d1b2a7f74ff013dc65655583b1eb7 (diff)
downloadnextcloud-server-cfed24cb0254caf570b2a520979a83435a677cc8.tar.gz
nextcloud-server-cfed24cb0254caf570b2a520979a83435a677cc8.zip
Merge pull request #47924 from ldidry/catch-MaxInstancesExceededException
🥅 — Catch MaxInstancesExceededException on calendar events
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/CalDAV/CalDavBackend.php47
1 files changed, 31 insertions, 16 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index bea8a913e40..8b619712b82 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -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