diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2024-05-07 15:55:47 +0200 |
---|---|---|
committer | Daniel <mail@danielkesselberg.de> | 2024-06-03 12:18:19 +0200 |
commit | 4be308ab26c4b2b03cad4a332d2343155cb39624 (patch) | |
tree | 828a234eb9b9657745bc96c285bc7b12b744f420 /apps/dav/tests/misc | |
parent | 06c01c568d6e1084a1fb2e2bc1015ea1a2d1c82f (diff) | |
download | nextcloud-server-4be308ab26c4b2b03cad4a332d2343155cb39624.tar.gz nextcloud-server-4be308ab26c4b2b03cad4a332d2343155cb39624.zip |
fix(caldav): event search with limit and timerange
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>
Diffstat (limited to 'apps/dav/tests/misc')
6 files changed, 97 insertions, 0 deletions
diff --git a/apps/dav/tests/misc/caldav-search-limit-timerange-1.ics b/apps/dav/tests/misc/caldav-search-limit-timerange-1.ics new file mode 100644 index 00000000000..e76ac3c9b2f --- /dev/null +++ b/apps/dav/tests/misc/caldav-search-limit-timerange-1.ics @@ -0,0 +1,17 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20240507T105946Z +LAST-MODIFIED:20240507T121113Z +DTSTAMP:20240507T121113Z +UID:07514c7b-1014-425c-b1b8-2c35ab0eea1d +SUMMARY:Event A +RRULE:FREQ=YEARLY +DTSTART;TZID=Europe/Berlin:20240101T101500 +DTEND;TZID=Europe/Berlin:20240101T111500 +TRANSP:OPAQUE +X-MOZ-GENERATION:4 +SEQUENCE:2 +END:VEVENT +END:VCALENDAR diff --git a/apps/dav/tests/misc/caldav-search-limit-timerange-2.ics b/apps/dav/tests/misc/caldav-search-limit-timerange-2.ics new file mode 100644 index 00000000000..fe948321d51 --- /dev/null +++ b/apps/dav/tests/misc/caldav-search-limit-timerange-2.ics @@ -0,0 +1,17 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20240507T110122Z +LAST-MODIFIED:20240507T121120Z +DTSTAMP:20240507T121120Z +UID:67cf8134-ff10-49a7-913d-acfeda463db6 +SUMMARY:Event B +RRULE:FREQ=YEARLY +DTSTART;TZID=Europe/Berlin:20240101T123000 +DTEND;TZID=Europe/Berlin:20240101T133000 +TRANSP:OPAQUE +X-MOZ-GENERATION:4 +SEQUENCE:2 +END:VEVENT +END:VCALENDAR diff --git a/apps/dav/tests/misc/caldav-search-limit-timerange-3.ics b/apps/dav/tests/misc/caldav-search-limit-timerange-3.ics new file mode 100644 index 00000000000..de7765b28d2 --- /dev/null +++ b/apps/dav/tests/misc/caldav-search-limit-timerange-3.ics @@ -0,0 +1,17 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20240507T120352Z +LAST-MODIFIED:20240507T121128Z +DTSTAMP:20240507T121128Z +UID:59090ca1-e52b-447f-8e08-491d1da729fa +SUMMARY:Event C +RRULE:FREQ=YEARLY +DTSTART;TZID=Europe/Berlin:20240101T151000 +DTEND;TZID=Europe/Berlin:20240101T161000 +TRANSP:OPAQUE +X-MOZ-GENERATION:2 +SEQUENCE:1 +END:VEVENT +END:VCALENDAR diff --git a/apps/dav/tests/misc/caldav-search-limit-timerange-4.ics b/apps/dav/tests/misc/caldav-search-limit-timerange-4.ics new file mode 100644 index 00000000000..b4d2f752c0a --- /dev/null +++ b/apps/dav/tests/misc/caldav-search-limit-timerange-4.ics @@ -0,0 +1,17 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20240507T120414Z +LAST-MODIFIED:20240507T121134Z +DTSTAMP:20240507T121134Z +UID:b1814d32-9adf-4518-8535-37f2c037f423 +SUMMARY:Event D +RRULE:FREQ=YEARLY +DTSTART;TZID=Europe/Berlin:20240101T164500 +DTEND;TZID=Europe/Berlin:20240101T171500 +TRANSP:OPAQUE +SEQUENCE:2 +X-MOZ-GENERATION:3 +END:VEVENT +END:VCALENDAR diff --git a/apps/dav/tests/misc/caldav-search-limit-timerange-5.ics b/apps/dav/tests/misc/caldav-search-limit-timerange-5.ics new file mode 100644 index 00000000000..1cd8b7ebf13 --- /dev/null +++ b/apps/dav/tests/misc/caldav-search-limit-timerange-5.ics @@ -0,0 +1,14 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20240507T122221Z +LAST-MODIFIED:20240507T122237Z +DTSTAMP:20240507T122237Z +UID:19c4e049-0b09-4101-a2ad-061a837e6a5e +SUMMARY:Cake Tasting +DTSTART;TZID=Europe/Berlin:20240509T151500 +DTEND;TZID=Europe/Berlin:20240509T171500 +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR diff --git a/apps/dav/tests/misc/caldav-search-limit-timerange-6.ics b/apps/dav/tests/misc/caldav-search-limit-timerange-6.ics new file mode 100644 index 00000000000..6c24d534281 --- /dev/null +++ b/apps/dav/tests/misc/caldav-search-limit-timerange-6.ics @@ -0,0 +1,15 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +BEGIN:VEVENT +CREATED:20240507T122246Z +LAST-MODIFIED:20240507T175258Z +DTSTAMP:20240507T175258Z +UID:60a7d310-aa7b-4974-8a8a-ff9339367e1d +SUMMARY:Pasta Day +DTSTART;TZID=Europe/Berlin:20240514T123000 +DTEND;TZID=Europe/Berlin:20240514T133000 +TRANSP:OPAQUE +X-MOZ-GENERATION:2 +END:VEVENT +END:VCALENDAR |