Skip to content

Conversation

@ChristophWurst
Copy link
Member

When we search for CalDAV objects in the DB we take the first and last
occurrence into account. For recurring events that is when they take
place the very first time and the very last time. Searching in a more
specific time range will still match this condition, because the
recurring event starts before the end of the requested range but ends
after the start of the requested range.

Sabre has filters for this. If we apply them on all search objects of a
search with a time range, then only the recurring events actually taking
place at the time of the requested time range will be returned.

Fixes nextcloud/calendar#3781

Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChristophWurst
Copy link
Member Author

LGTM

Could you please also test and try to break this? It's some critical code :)

@ChristophWurst ChristophWurst force-pushed the fix/caldav-search-time-range-recurrence branch from c341375 to b88c1c9 Compare December 2, 2021 15:10
@ChristophWurst ChristophWurst requested review from a team, ArtificialOwl, icewind1991, juliusknorr and st3iny and removed request for a team December 2, 2021 15:10
@miaulalala
Copy link
Contributor

Tested it, works as expected!

@ChristophWurst ChristophWurst force-pushed the fix/caldav-search-time-range-recurrence branch from b88c1c9 to 2e8cf44 Compare December 2, 2021 16:19
@ChristophWurst
Copy link
Member Author

/backport to stable23

Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works.

@ChristophWurst ChristophWurst force-pushed the fix/caldav-search-time-range-recurrence branch from 2e8cf44 to 454f27c Compare December 7, 2021 11:39
@ChristophWurst

This comment has been minimized.

@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 Dec 7, 2021
@ChristophWurst ChristophWurst force-pushed the fix/caldav-search-time-range-recurrence branch from 454f27c to 97797a2 Compare December 9, 2021 20:17
When we search for CalDAV objects in the DB we take the first and last
occurence into account. For recurring events that is when they take
place the very first time and the very last time. Searching in a more
specific time range will still match this condition, because the
recurring event starts before the end of the requested range but ends
after the start of the requested range.

Sabre has filters for this. If we apply them on all seach objects of a
search with a time range, then only the recurring events actually taking
place at the time of the requested time range will be returned.

Signed-off-by: Christoph Wurst <[email protected]>
@ChristophWurst ChristophWurst force-pushed the fix/caldav-search-time-range-recurrence branch from 97797a2 to b005846 Compare December 13, 2021 14:58
@st3iny
Copy link
Member

st3iny commented Dec 14, 2021

Merge?

@ChristophWurst ChristophWurst merged commit 5613ff3 into master Dec 14, 2021
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 feature: dav

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recurring events block all appointment slots

4 participants