Repository navigation
fix(CalDAV/Backend/PDO): include RDATE instances in lastoccurence - #1689
Open
PhilflowIO wants to merge 1 commit into
Open
PhilflowIO wants to merge 1 commit into
PhilflowIO wants to merge 1 commit into
Conversation
getDenormalizedData() only ran the EventIterator for events with an RRULE. For an event that recurs through RDATE alone, lastoccurence was set to the end of the first instance, so calendarQuery() filtered out every later RDATE instance in SQL before the validator saw the object. Run the same iterator loop for RDATE events and keep the latest end, since RDATE values do not have to be in chronological order. If the iterator throws (all instances removed by EXDATE, or RDATE;VALUE=PERIOD, sabre-io/vobject#601), keep the end of the first instance as before so such objects can still be stored.
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1688
getDenormalizedData()only ran the EventIterator for events with an RRULE. An event that recurs through RDATE alone gotlastoccurence= end of its first instance, socalendarQuery()dropped it in SQL for every later RDATE instance.Change
getLastOccurenceOfRecurrence(). RRULE events call it as before.lastoccurence; the stored value can only grow compared to today.NoInstancesException(EXDATE removes every instance) andInvalidDataException(RDATE;VALUE=PERIOD, RDATE PERIOD with TZID doesn't seem to be recognised vobject#601) are caught and the first instance's end is kept, so these objects still store with 201 instead of failing with a 500.Tests
Added to
tests/Sabre/CalDAV/Backend/AbstractPDOTestCase.php:testCreateCalendarObjectRDate(RDATE values out of order)testCreateCalendarObjectRDatePeriodtestCreateCalendarObjectRDateNoInstancestestCalendarQueryTimeRangeRDateThe first and last fail without the fix. Run on SQLite only; the MySQL and PostgreSQL variants were skipped locally.
Full suite on PHP 8.5.12: 1680 tests, the only errors are the two existing
testGetLastModifieddeprecations (ctype_digit()), same as on master without this change. php-cs-fixer (dry run) and phpstan pass.Notes
bin/if you want it.