Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented May 29, 2024

Backport of PR #45222

@backportbot backportbot bot requested a review from kesselb May 29, 2024 14:54
@backportbot backportbot bot added bug 3. to review Waiting for reviews feature: caldav Related to CalDAV internals labels May 29, 2024
@backportbot backportbot bot added this to the Nextcloud 29.0.2 milestone May 29, 2024
@Altahrim Altahrim mentioned this pull request Jun 6, 2024
19 tasks
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>
@ChristophWurst ChristophWurst 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 stable29 Jun 7, 2024
163 of 168 checks passed
@skjnldsv skjnldsv deleted the backport/45222/stable29 branch June 7, 2024 10:12
@blizzz blizzz mentioned this pull request Jun 11, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: caldav Related to CalDAV internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants