Skip to content

change:optimize iCalendar recurrence evaluation with guarded seeking - #145

Merged
greenbonebot merged 2 commits into
mainfrom
fix/icalendar-recurrence-performance
Oct 27, 2026
Merged

greenbonebot merged 2 commits into
mainfrom
fix/icalendar-recurrence-performance

Conversation

@ozgen

@ozgen ozgen commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What

Optimize iCalendar recurrence evaluation using guarded libical seeking. Preserve existing scheduling behavior and fall back to historical iteration when seeking is unsafe. Require libical ≥ 3.0.11.

Verified with existing utility tests and comparisons against the original recurrence calculation.

Why

Frequent schedules with old start dates can require millions of iterations, causing excessive CPU usage and potential denial of service. This reduces unnecessary historical iteration for supported rules.

References

GEA-2164

Checklist

  • I have used the following LLMs/AI tools in this pull request: Codex GPT-6.1-Sol

Skip historical occurrences for eligible UTC rules and plain
non-UTC subdaily rules with INTERVAL=1.

Preserve DTSTART, recurrence phase, and next/previous behavior.
Keep the original iterator when seeking fails or validation rejects
the candidate.

Require libical >= 3.0.11.
@ozgen
ozgen requested a review from a team as a code owner October 26, 2026 12:54
@greenbonebot
greenbonebot enabled auto-merge (rebase) October 26, 2026 12:54
timopollmeier
timopollmeier previously approved these changes Oct 27, 2026
Extract the guarded seek logic to simplify recurrence evaluation
and fix indentation without changing scheduling behavior.
@greenbonebot
greenbonebot merged commit 15eaf92 into main Oct 27, 2026
18 checks passed
@greenbonebot
greenbonebot deleted the fix/icalendar-recurrence-performance branch October 27, 2026 10:50
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.

3 participants