|
66 | 66 | use Sabre\VObject\Reader; |
67 | 67 | use Sabre\VObject\Recur\EventIterator; |
68 | 68 | use Sabre\VObject\Recur\NoInstancesException; |
| 69 | +use Sabre\VObject\Recur\MaxInstancesExceededException; |
69 | 70 | use function array_column; |
70 | 71 | use function array_map; |
71 | 72 | use function array_merge; |
@@ -1723,6 +1724,12 @@ public function calendarQuery($calendarId, array $filters, $calendarType = self: |
1723 | 1724 | 'exception' => $ex, |
1724 | 1725 | ]); |
1725 | 1726 | continue; |
| 1727 | + } catch (MaxInstancesExceededException $ex) { |
| 1728 | + $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'], [ |
| 1729 | + 'app' => 'dav', |
| 1730 | + 'exception' => $ex, |
| 1731 | + ]); |
| 1732 | + continue; |
1726 | 1733 | } |
1727 | 1734 |
|
1728 | 1735 | if (!$matches) { |
@@ -2072,24 +2079,32 @@ private function searchCalendarObjects(IQueryBuilder $query, DateTimeInterface|n |
2072 | 2079 | continue; |
2073 | 2080 | } |
2074 | 2081 |
|
2075 | | - $isValid = $this->validateFilterForObject($row, [ |
2076 | | - 'name' => 'VCALENDAR', |
2077 | | - 'comp-filters' => [ |
2078 | | - [ |
2079 | | - 'name' => 'VEVENT', |
2080 | | - 'comp-filters' => [], |
2081 | | - 'prop-filters' => [], |
2082 | | - 'is-not-defined' => false, |
2083 | | - 'time-range' => [ |
2084 | | - 'start' => $start, |
2085 | | - 'end' => $end, |
| 2082 | + try { |
| 2083 | + $isValid = $this->validateFilterForObject($row, [ |
| 2084 | + 'name' => 'VCALENDAR', |
| 2085 | + 'comp-filters' => [ |
| 2086 | + [ |
| 2087 | + 'name' => 'VEVENT', |
| 2088 | + 'comp-filters' => [], |
| 2089 | + 'prop-filters' => [], |
| 2090 | + 'is-not-defined' => false, |
| 2091 | + 'time-range' => [ |
| 2092 | + 'start' => $start, |
| 2093 | + 'end' => $end, |
| 2094 | + ], |
2086 | 2095 | ], |
2087 | 2096 | ], |
2088 | | - ], |
2089 | | - 'prop-filters' => [], |
2090 | | - 'is-not-defined' => false, |
2091 | | - 'time-range' => null, |
2092 | | - ]); |
| 2097 | + 'prop-filters' => [], |
| 2098 | + 'is-not-defined' => false, |
| 2099 | + 'time-range' => null, |
| 2100 | + ]); |
| 2101 | + } catch (MaxInstancesExceededException $ex) { |
| 2102 | + $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'], [ |
| 2103 | + 'app' => 'dav', |
| 2104 | + 'exception' => $ex, |
| 2105 | + ]); |
| 2106 | + continue; |
| 2107 | + } |
2093 | 2108 |
|
2094 | 2109 | if (is_resource($row['calendardata'])) { |
2095 | 2110 | // Put the stream back to the beginning so it can be read another time |
|
0 commit comments