From 838ee4b8e5fb051b6f3190f4ffa431d5235b2e3a Mon Sep 17 00:00:00 2001 From: Matthieu MALVACHE Date: Sun, 22 Feb 2026 17:52:21 +0100 Subject: [PATCH] fix(calendar): produce correct JMAP patch when removing recurrence rules Include recurrenceRules, recurrenceOverrides, and excludedRecurrenceRules in the update patch when clearing recurrence from an event. Also fix "this and future" scope overriding user's recurrence changes. Fixes #14 --- app/[locale]/calendar/page.tsx | 2 +- components/calendar/event-modal.tsx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/[locale]/calendar/page.tsx b/app/[locale]/calendar/page.tsx index 5dfb7a10..1567ac8b 100644 --- a/app/[locale]/calendar/page.tsx +++ b/app/[locale]/calendar/page.tsx @@ -349,9 +349,9 @@ export default function CalendarPage() { freeBusyStatus: master.freeBusyStatus, privacy: master.privacy, showWithoutTime: master.showWithoutTime, + recurrenceRules: originalRules, ...updates, start: updates.start || occurrenceStart, - recurrenceRules: originalRules, }; delete (newEventData as Record).id; delete (newEventData as Record).uid; diff --git a/components/calendar/event-modal.tsx b/components/calendar/event-modal.tsx index 89dafcf6..7b8977f8 100644 --- a/components/calendar/event-modal.tsx +++ b/components/calendar/event-modal.tsx @@ -237,6 +237,8 @@ export function EventModal({ relativeTo: null, }, }; + } else if (isEdit && event?.locations && Object.keys(event.locations).length > 0) { + data.locations = null; } if (recurrence !== "none") { @@ -259,6 +261,10 @@ export function EventModal({ count: null, until: null, }]; + } else if (isEdit && event?.recurrenceRules?.length) { + data.recurrenceRules = null; + if (event.recurrenceOverrides) data.recurrenceOverrides = null; + if (event.excludedRecurrenceRules) data.excludedRecurrenceRules = null; } if (alert !== "none") { @@ -272,6 +278,8 @@ export function EventModal({ relatedTo: null, }, }; + } else if (isEdit && event?.alerts && Object.keys(event.alerts).length > 0) { + data.alerts = null; } if (attendees.length > 0 && currentUserEmails.length > 0) {