|
99 | 99 | use Sabre\VObject\Property; |
100 | 100 | use Sabre\VObject\Reader; |
101 | 101 | use Sabre\VObject\Recur\EventIterator; |
| 102 | +use Sabre\VObject\Recur\MaxInstancesExceededException; |
102 | 103 | use Sabre\VObject\Recur\NoInstancesException; |
103 | 104 | use function array_column; |
104 | 105 | use function array_map; |
@@ -1711,6 +1712,12 @@ public function calendarQuery($calendarId, array $filters, $calendarType = self: |
1711 | 1712 | 'exception' => $ex, |
1712 | 1713 | ]); |
1713 | 1714 | continue; |
| 1715 | + } catch (MaxInstancesExceededException $ex) { |
| 1716 | + $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'], [ |
| 1717 | + 'app' => 'dav', |
| 1718 | + 'exception' => $ex, |
| 1719 | + ]); |
| 1720 | + continue; |
1714 | 1721 | } |
1715 | 1722 |
|
1716 | 1723 | if (!$matches) { |
@@ -2060,24 +2067,32 @@ private function searchCalendarObjects(IQueryBuilder $query, DateTimeInterface|n |
2060 | 2067 | continue; |
2061 | 2068 | } |
2062 | 2069 |
|
2063 | | - $isValid = $this->validateFilterForObject($row, [ |
2064 | | - 'name' => 'VCALENDAR', |
2065 | | - 'comp-filters' => [ |
2066 | | - [ |
2067 | | - 'name' => 'VEVENT', |
2068 | | - 'comp-filters' => [], |
2069 | | - 'prop-filters' => [], |
2070 | | - 'is-not-defined' => false, |
2071 | | - 'time-range' => [ |
2072 | | - 'start' => $start, |
2073 | | - 'end' => $end, |
| 2070 | + try { |
| 2071 | + $isValid = $this->validateFilterForObject($row, [ |
| 2072 | + 'name' => 'VCALENDAR', |
| 2073 | + 'comp-filters' => [ |
| 2074 | + [ |
| 2075 | + 'name' => 'VEVENT', |
| 2076 | + 'comp-filters' => [], |
| 2077 | + 'prop-filters' => [], |
| 2078 | + 'is-not-defined' => false, |
| 2079 | + 'time-range' => [ |
| 2080 | + 'start' => $start, |
| 2081 | + 'end' => $end, |
| 2082 | + ], |
2074 | 2083 | ], |
2075 | 2084 | ], |
2076 | | - ], |
2077 | | - 'prop-filters' => [], |
2078 | | - 'is-not-defined' => false, |
2079 | | - 'time-range' => null, |
2080 | | - ]); |
| 2085 | + 'prop-filters' => [], |
| 2086 | + 'is-not-defined' => false, |
| 2087 | + 'time-range' => null, |
| 2088 | + ]); |
| 2089 | + } catch (MaxInstancesExceededException $ex) { |
| 2090 | + $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'], [ |
| 2091 | + 'app' => 'dav', |
| 2092 | + 'exception' => $ex, |
| 2093 | + ]); |
| 2094 | + continue; |
| 2095 | + } |
2081 | 2096 |
|
2082 | 2097 | if (is_resource($row['calendardata'])) { |
2083 | 2098 | // Put the stream back to the beginning so it can be read another time |
|
0 commit comments