Skip to content

[stable29] CalDAV fix search with limit and time range - #45566

Merged
skjnldsv merged 2 commits into
stable29from
backport/45222/stable29
Jun 7, 2024
Merged

[stable29] CalDAV fix search with limit and time range#45566
skjnldsv merged 2 commits into
stable29from
backport/45222/stable29

Conversation

@backportbot

Copy link
Copy Markdown

Backport of PR #45222

@backportbot
backportbotBot requested a review from kesselbMay 29, 2024 14:54
@backportbotbackportbotBot added bug 3. to review Waiting for reviews feature: caldav Related to CalDAV internals labels May 29, 2024
@backportbotbackportbotBot added this to the Nextcloud 29.0.2 milestone May 29, 2024
@kesselb
kesselbforce-pushed the backport/45222/stable29 branch from de1ed77 to 1f82966CompareJune 3, 2024 15:52
@AltahrimAltahrim mentioned this pull request Jun 6, 2024
19 tasks
kesselb added 2 commits June 6, 2024 12:29
Event recurrences are evaluated at runtime because the database only knows the first and last occurrence.
Given, a user created 8 events with a yearly reoccurrence and two for events tomorrow.
The upcoming event widget asks the CalDAV backend for 7 events within the next 14 days.
If limit 7 is applied to the SQL query, we find the 7 events with a yearly reoccurrence and discard the events after evaluating the reoccurrence rules because they are not due within the next 14 days and end up with an empty result even if there are two events to show.
The workaround for search requests with a limit and time range is asking for more row than requested and retrying if we have not reached the limit.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Sorting the events by the start date leads to more predictable results for the search API consumers.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
kesselbforce-pushed the backport/45222/stable29 branch from 1f82966 to 8330825CompareJune 6, 2024 10:29
@ChristophWurstChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jun 6, 2024
@skjnldsv
skjnldsv merged commit 0c8e34e into stable29Jun 7, 2024
@skjnldsv
skjnldsv deleted the backport/45222/stable29 branch June 7, 2024 10:12
@blizzzblizzz mentioned this pull request Jun 11, 2024
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finishbugfeature: caldavRelated to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@kesselb@miaulalala@ChristophWurst@skjnldsv