Skip to content

Conversation

@backportbot
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 kesselb force-pushed the backport/45222/stable27 branch from afa6104 to ed4c18b Compare May 31, 2024 13:02
@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
kesselb added 2 commits June 3, 2024 12:17
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 <[email protected]>
Sorting the events by the start date leads to more predictable results for the search API consumers.

Signed-off-by: Daniel Kesselberg <[email protected]>
@kesselb kesselb force-pushed the backport/45222/stable27 branch from ed4c18b to dead362 Compare June 3, 2024 10:17
@kesselb kesselb merged commit e3793fe into stable27 Jun 3, 2024
@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.

4 participants