Merge branch 'fix/calquery-open-ended-time-range' into 'master'

calquery: don't drop events beyond the capped expansion window on open-ended time-range

See merge request davical-project/davical!149
This commit is contained in:
jul2026v2 2026-07-27 17:13:11 +00:00
commit dcfe4b6549
2 changed files with 31 additions and 3 deletions

View File

@ -456,7 +456,15 @@ if ( $qry->Exec("calquery",__LINE__,__FILE__) && $qry->rows() > 0 ) {
$expanded = expand_event_instances($vResource, $expand_range_start, $expand_range_end, $expand_as_floating , $dav_object->collection_tzid);
if ( $expanded->ComponentCount() == 0 ) continue;
# An empty expansion only proves a non-match when the expansion
# window equals the requested range. For an open-ended time-range
# ($range_filter->until is null) the window is artificially capped
# (expand_range_end defaults to time_range_start + 730 days), so a
# future or sparsely-recurring event whose next instance lies beyond
# the cap must NOT be dropped here -- the getVCalendarRange()->overlaps()
# test above is already exact for open ranges. Only enforce the
# empty-window skip for a real upper bound or an explicit expansion.
if ( $expanded->ComponentCount() == 0 && ( $need_expansion || isset($range_filter->until) ) ) continue;
# We only keep the expanded instaneces if need_expansion is set,
# RFC4791 Section 7.4. Otherwise we should return the original

View File

@ -2,8 +2,8 @@ HTTP/1.1 207 Multi-Status
Date: Dow, 01 Jan 2000 00:00:00 GMT
DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
ETag: "6ad84d1cc9770bcf7085b8316a7b7791"
Content-Length: 614
ETag: "07e5733ac3d62135fd59bf6e733f174f"
Content-Length: 1103
Content-Type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8" ?>
@ -28,5 +28,25 @@ Content-Type: text/xml; charset="utf-8"
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/home/0544-gzip-PUT.ics</href>
<propstat>
<prop>
<getetag>"6ddd18264a9d40c1c9d37a005eeb7e4f"</getetag>
<resourcetype/>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
<response>
<href>/caldav.php/user1/home/0545-deflate-PUT.ics</href>
<propstat>
<prop>
<getetag>"4a3aa58a3e11487e87d87024465d4182"</getetag>
<resourcetype/>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>