Skip to content

fix(dav): make reminder and recurrence handling robust - #67045

Merged
GVodyanov merged 1 commit into
masterfrom
fix/dav/reminder-robustness
Nov 27, 2026
Merged

GVodyanov merged 1 commit into
masterfrom
fix/dav/reminder-robustness

Conversation

@GVodyanov

Copy link
Copy Markdown
Contributor
  • Resolves: #

Summary

A few fixes to how reminders are stored, processed and computed.

  • Subscription deletion: SubscriptionListener removed reminders by the subscription id, but calendar_reminders.calendar_id refers to oc_calendars, so deleting a subscription removed the pending reminders of an unrelated calendar. Subscriptions never get reminders, so that cleanup is dropped. BuildReminderIndexBackgroundJob no longer indexes subscription objects either.
  • Processing: ReminderService::processReminders() handled all due reminders in one loop that only caught MaxInstancesExceededException. A reminder that failed in any other way aborted the run and stayed queued, so every later run stopped at it. Each reminder is now processed on its own; one that fails is logged and removed, like reminders of invalid events.
  • Private events: reminders of shared calendars went to sharees for CLASS:PRIVATE events too. They now go to the owner only, matching how private events are shown to sharees.
  • Large COUNT / REPEAT: EventReaderRRule::concludes() stepped through every occurrence of a COUNT rule, and getRemindersForVAlarm() expanded REPEAT without a bound. A COUNT above Sabre\VObject\Settings::$maxRecurrences is now treated like an endless rule (lastoccurence = CalDavBackend::MAX_DATE). REPEAT is only used together with DURATION, as RFC 5545 requires, and capped at 100 additional reminders.

Behaviour changes

  • A reminder that fails to process is removed instead of being retried on every run.
  • Private events in shared calendars are reminded to the owner only. Public and confidential events are unchanged.
  • An event with more than 3500 counted occurrences ends on 2038-01-01 as far as lastoccurence and iMIP texts are concerned, like endless rules.
  • An alarm with more than 100 repetitions gets 100; REPEAT without DURATION is ignored.
  • Reminders already removed by a subscription deletion are recreated when the event is saved again.

TODO

  • Manual test on a live instance

Checklist

AI (if applicable)

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

Assisted by ClaudeCode:claude-opus-5-5

Deleting a webcal subscription removed reminders by the subscription
id, but calendar_reminders.calendar_id refers to calendars, so it
removed the pending reminders of an unrelated calendar. Subscriptions
never get reminders, so that cleanup is dropped, and the reminder index
job no longer indexes subscription objects either.

Due reminders were processed in one loop that only caught
MaxInstancesExceededException. A reminder that failed in any other way
aborted the run and stayed queued, so every later run stopped at it
and no reminders were sent. Each reminder is now processed on its own;
one that fails is logged and removed, like reminders of invalid events.

Reminders of shared calendars went to sharees for private events as
well. They now go to the owner only, matching how private events are
shown to sharees.

The last occurrence of a COUNT rule was found by stepping through
every occurrence, and REPEAT alarms were expanded REPEAT times, both
without an upper bound. A COUNT above Sabre's maxRecurrences is now
treated like an endless rule, and REPEAT is only used together with
DURATION, as RFC 5545 requires, capped at 100 additional reminders.

Reminders already removed by a subscription deletion are not restored;
they are recreated when the event is saved again.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
@GVodyanov GVodyanov added the 3. to review Waiting for reviews label Nov 26, 2026
@GVodyanov
GVodyanov requested review from come-nc and provokateurin and removed request for a team November 26, 2026 13:28
@kesselb

kesselb commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

@GVodyanov backports?

@GVodyanov
GVodyanov merged commit e44a502 into master Nov 27, 2026
165 of 180 checks passed
@GVodyanov
GVodyanov deleted the fix/dav/reminder-robustness branch November 27, 2026 14:37
@GVodyanov

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@GVodyanov

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@GVodyanov

Copy link
Copy Markdown
Contributor Author

/backport to stable33

@GVodyanov

Copy link
Copy Markdown
Contributor Author

/backport to stable32

@GVodyanov

Copy link
Copy Markdown
Contributor Author

/backport to stable31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants