Michael Braun bf0f92842c calquery: don't drop events beyond the capped expansion window on open-ended time-range
A calendar-query REPORT whose <C:time-range> has a start but no end
(RFC 4791 section 9.9: an absent end means +infinity) dropped every event
whose next occurrence fell beyond time_range_start + 730 days: future
single events and sparse recurrences (e.g. FREQ=YEARLY;INTERVAL=4).
Clients such as DAVx5 send exactly this shape when they limit how far
into the past they sync, so those events silently disappeared.

The SQL prefilter is not at fault: for an open range it correctly emits
only the lower-bound condition. The drop happens in the post-fetch loop:
for any time-range query each resource is expanded into
[expand_range_start, expand_range_end] and skipped when the expansion is
empty (ComponentCount() == 0). For an open range expand_range_end is
capped at start + 730 days, so an event with no instance inside that cap
is discarded even though the preceding
getVCalendarRange()->overlaps($range_filter) test -- which treats a null
upper bound as +infinity -- already proved that it matches.

This became user-visible in 1.1.12: commit b40c96de ("If time-range is
set, only return matching events.") extended the empty-expansion skip,
previously reached only for explicit <C:expand> requests, to every
time-range query via isset($range_filter).

Only enforce the empty-expansion skip when the upper bound is real
(range_filter->until is set) or the client explicitly requested expansion
(need_expansion). For an open range the exact overlaps() test above stands
and the unexpanded master component is returned as normal. Bounded and
<C:expand> queries are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-27 18:53:04 +02:00
2024-01-21 19:12:42 +13:00
2026-05-11 23:56:53 +02:00
2011-02-21 22:44:57 +13:00
2024-04-02 21:41:26 +13:00
2010-12-25 14:24:44 +13:00
2017-01-08 15:48:52 +01:00
2010-01-11 10:15:47 +13:00
2026-05-11 23:56:53 +02:00

DAViCal CalDAV Server by Andrew McMillan.

For documentation you are best advised to visit the DAViCal
website at https://www.davical.org/ or search our general mailing
list at https://lists.sourceforge.net/mailman/listinfo/davical-general

There's lots of useful information at https://wiki.davical.org/ as well,
and if you want access to update that contact us on IRC (#davical on OFTC,
be patient and stick around for a while) or send an e-mail
to <wiki-access@davical.org>.

Good luck!

Andrew McMillan

-----------------------------------------------
Copyright: 2006-2011 Andrew McMillan <andrew@mcmillan.net.nz>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA
Description
DAViCal is a server for calendar sharing. It is an implementation of the CalDAV protocol which is designed for storing calendaring resources (in iCalendar format) on a remote shared server.
Readme
Languages
PHP 71%
PLpgSQL 13.2%
Perl 11.7%
Shell 2%
Prolog 0.6%
Other 1.5%