Skip to content

feat(caldav): RRULE-aware time-range matching and CALDAV:expand/limit for REPORT - #21

Merged
ersinkoc merged 1 commit into
mainfrom
fix/caldav-rrule-expand
Oct 2, 2026
Merged

ersinkoc merged 1 commit into
mainfrom
fix/caldav-rrule-expand

Conversation

@ersinkoc

@ersinkoc ersinkoc commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

What

Implements the recorded CalDAV REPORT features (the round-55 design list):

  • RRULE-aware time-range matching (RFC 4791 §9.9.1): a recurring
    component matches when ANY generated instance intersects the range —
    the base DTSTART alone is no longer decisive. Supported subset:
    FREQ=DAILY|WEEKLY|MONTHLY|YEARLY; INTERVAL; COUNT; UNTIL. Unsupported
    parts (BYDAY, BYMONTH, ...) degrade the event to base-only matching
    (documented).
  • CALDAV:expand (§9.6.5): the response calendar-data contains
    RECURRENCE-ID'd VEVENT instances within the expand window (parsed from
    its RFC location inside DAV:prop).
  • CALDAV:limit (§9.6.4): limit/nresults caps the returned instances.
  • Non-recurring events and the no-filter passthrough behave exactly as
    before.

Verification

  • RED before: a DAILY;COUNT=10 event (base Mar 1) was invisible to a
    Mar 5 time-range REPORT; the expand request returned 0 RECURRENCE-ID
    instances. GREEN after: all three new tests pass.
  • go vet ./internal/caldav/ clean; caldav package ok; full suite
    go test ./... exit 0 / 37 ok (r71-suite.log).

… for REPORT

Recurring components now match calendar-query time-ranges through their
generated instances (RFC 4791 §9.9.1): parseRRULEBlock/parseRRULEValue
support FREQ=DAILY|WEEKLY|MONTHLY|YEARLY; INTERVAL; COUNT; UNTIL, and
rruleInstances generates instances with a bounded iteration cap —
compFilterMatches matches when ANY instance intersects the range.
Unsupported RRULE parts degrade the event to base-only matching
(documented subset).

CALDAV:expand/limit are parsed from their RFC 4791 §9.6 location inside
DAV:prop: expand replaces the response calendar-data with RECURRENCE-ID'd
VEVENT instances within the expand window (non-recurring events pass
through when their base time is inside); limit/nresults caps the
instances.

Regression: internal/caldav/calendarquery_rrule_expand_test.go — red
before the feature (the recurring event was invisible to a Mar 5
time-range REPORT; 0 RECURRENCE-ID instances), green after.
@ersinkoc
ersinkoc merged commit db67415 into main Oct 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant