Fix: free-busy REPORT always fails when max_freebusy_occurrence is 0

free_busy_report() explicitly handles [reporting] max_freebusy_occurrence = 0
as "limit disabled" when fetching occurrences (n=0 lets time_range_fill
return all occurrences), but the subsequent limit check
'len(occurrences) >= max_occurrence' is trivially true for
max_occurrence == 0, so every free-busy query on a non-empty calendar
raised ValueError ("FREEBUSY occurrences limit of 0 hit") and was
answered with HTTP 400.

Skip the limit check when the limit is disabled, consistent with how
xml_report() treats the same setting ('if max_occurrence and ...').
Behavior for positive limits is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
TowyTowy
2026-07-17 01:06:51 +02:00
parent 8d76bdde43
commit f38688456d
3 changed files with 14 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
# Changelog
## 3.7.7.dev
* Fix: free-busy REPORT always failed with HTTP 400 ("FREEBUSY occurrences limit of 0 hit") when [reporting] max_freebusy_occurrence is set to 0 (limit disabled), because the limit check did not honor the disabled limit
* Fix: time-range filter treated a VEVENT with a whole-day DURATION (e.g. P1D, P2D) as zero-length (timedelta.seconds instead of total_seconds), so such events were missing from calendar-query REPORT results
* Fix: calendar-data expand (REPORT) left recurrence properties (e.g. RDATE) on the expanded single-occurrence VEVENTs; a single try/except around the sequential delattr() calls stopped at the first absent property (e.g. missing EXDATE), so later ones were never removed
* Fix: text-match filter on a structured property (e.g. vCard N or ADR) crashed with HTTP 500 (AttributeError: 'Name'/'Address' object has no attribute 'lower') because vobject parses these into non-string objects; their text representation is now used