Skip to content

fix: recurrance recalulation with excemption - #923

Merged
SebastianKrupinski merged 1 commit into
mainfrom
fix/recurrance-recalulation-with-excemption
Sep 2, 2026
Merged

fix: recurrance recalulation with excemption#923
SebastianKrupinski merged 1 commit into
mainfrom
fix/recurrance-recalulation-with-excemption

Conversation

@SebastianKrupinski

@SebastianKrupinski SebastianKrupinski commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Bug

When a recurring event's master startDate is shifted (e.g. dragging/editing the whole series), the method looped over _recurrenceExceptionItems, items are keyed by each exception's recurrence-id, to shift every exception's recurrence-id by the same delta. The loop did this by deleting each entry and re-inserting it under its new (shifted) key, while iterating that same live Map. The JS Map iterator revisits entries inserted during iteration, so the just-shifted entry got visited again, shifted again, and re-inserted again — forever.

Fix

Don't use the live map.

Bonus find:
fixing this exposed that an existing test's hardcoded "expected" output had baked in the old bug's behavior

Bonus

Added 9 scenario tests for updateStartDateOfMasterItem covering:

  • Forward, backward, zero-length, and month-boundary shifts
  • Multiple adjacent recurrence exceptions
  • THISANDFUTURE range exceptions
  • EXDATE/RDATE interactions
  • RDATE-based exceptions
  • RRULE UNTIL and COUNT
  • All-day events and leap-day boundaries
  • infinite-loop regression

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
@SebastianKrupinski
SebastianKrupinski force-pushed the fix/recurrance-recalulation-with-excemption branch from fd68fb2 to a796080 Compare September 1, 2026 17:37
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@odzhychko odzhychko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can be merged a merged after resolving the one suggestion.

Comment thread src/recurrence/recurrenceManager.js
@odzhychko

Copy link
Copy Markdown

Uff, never have thought of that just changing the start date might needs recalculating RECURRENCE-IDs.

Comment thread tests/integration/editing/updateMasterStartDate.test.js
Comment thread src/recurrence/recurrenceManager.js
@SebastianKrupinski
SebastianKrupinski merged commit 58db76a into main Sep 2, 2026
10 checks passed
@SebastianKrupinski
SebastianKrupinski deleted the fix/recurrance-recalulation-with-excemption branch September 2, 2026 13:18
@github-project-automation github-project-automation Bot moved this from 🏗️ In progress to ☑️ Done in 💌 📅 👥 Groupware team Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

2 participants