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

[stable27] CalDAV fix search with limit and time range #45568

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented May 29, 2024

Backport of #45222

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@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 27.1.10 milestone May 29, 2024
@kesselb
Copy link
Contributor

kesselb commented May 31, 2024

Conflicts mainly with #44196.

Rebased pull request on top of #44196 and cherry-picked the commits.

@kesselb kesselb marked this pull request as ready for review May 31, 2024 13:03
@kesselb kesselb requested a review from tcitworld as a code owner May 31, 2024 13:03
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 kesselb merged commit e3793fe into stable27 Jun 3, 2024
38 checks passed
@kesselb kesselb deleted the backport/45222/stable27 branch June 3, 2024 15:45
@blizzz blizzz mentioned this pull request Jun 11, 2024
1 task
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 bug feature: caldav Related to CalDAV internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants