Commit graph

211 commits

Author SHA1 Message Date
SebastianKrupinski
9f3d07e339 fix(caldav): Throw 403 Forbidden Error instead of 500 Internal Server Error
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
2024-07-18 08:17:13 +00:00
Daniel Kesselberg
8330825f3e feat(caldav): order the calendar objects by start date for search
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>
2024-06-06 12:29:29 +02:00
Daniel Kesselberg
449af33c29 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>
2024-06-06 12:29:29 +02:00
Anna Larch
ec94f5499c fix(caldav): automatically delete outdated scheduling objects
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-06-03 11:10:03 +00:00
Daniel Kesselberg
9faddcd5d8
feat(caldav): expose calendar subscriptions
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-05-08 10:49:21 +02:00
Côme Chilliet
82e593b83b
chore: Fix small psalm errors related to documented return types
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-05-06 18:21:38 +02:00
Côme Chilliet
0b332ceac2 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-04 11:45:22 +02:00
Christoph Wurst
3dea99f42b
fix(dav): Add retention time to sync token cleanup
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-03-21 18:37:21 +01:00
Christoph Wurst
f40f962c2e
fix(dav): Add occ command to fix missing caldav sync tokens
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-03-12 12:44:00 +01:00
Christoph Wurst
a2fcf50f43
fix(dav): Fix atomic calendar/subscription updates
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-02-29 09:42:51 +01:00
Patrick Fischer
0f16153e4a Bug fix: Select the correct table based on CALENDAR_TYPE_CALENDAR
Signed-off-by: Patrick Fischer <mail@patrickfischer.ch>
2024-02-23 16:18:01 +01:00
Christoph Wurst
dc7f2baf26 fix(dav): Rate limit calendar/subscription creation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-02-23 08:52:59 +01:00
Anna Larch
dce69154ba enh(sharing): enable unsharing for sharees for DAV shares (addressbooks and calendars)
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-02-15 18:01:12 +01:00
Anna Larch
3475d52741 fix(caldav): don't reuse query builder objects
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-12-11 11:32:32 +01:00
Benjamin Gaussorgues
3545a1c613
feat(caldav): Allow advanced search for events/tasks
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-10 09:21:16 +01:00
Christoph Wurst
91b31bfb15
fix(dav): Reduce CalDAV backend memory footprint
fetchAll inflates memory. Fetching in a loop allows GC to run earlier
and more often.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-11-02 11:12:34 +01:00
Richard Steinmetz
ace08819f9
fix(dav): expand recurrences when searching
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2023-09-21 23:28:35 +02:00
Robin Appelman
30e9f520f3
Merge pull request #39568 from nextcloud/caldav-share-preload
Calendar optimizations
2023-08-14 10:27:35 +02:00
Jamie McClelland
4a98bb9972 ensure outerquery ->where() function doesn't clobber earier ->andWhere()
Signed-off-by: Jamie McClelland <jm@mayfirst.org>
2023-08-07 14:43:23 -04:00
Jamie McClelland
ece685d6f5 optimize calendar search query
see https://github.com/nextcloud/calendar/issues/4758

Signed-off-by: Jamie McClelland <jm@mayfirst.org>
2023-08-07 14:43:23 -04:00
Robin Appelman
7c02eedabb
cache calendar objects from calendarQuery
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-07-26 14:36:39 +02:00
Robin Appelman
31c483b759
preload shares for calendars when listing calendars
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-07-26 14:36:37 +02:00
Joas Schilling
e9ac0287f2
Merge pull request #39297 from nextcloud/fix/dav/close-cursor
fix(dav): close cursor when fetching max id
2023-07-12 20:35:54 +02:00
Richard Steinmetz
9206c0f473
fix(dav): close cursor when fetching max id
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2023-07-11 08:05:34 +02:00
Joas Schilling
f59c74062a
fix(dav): Move DAV app to non deprecated event dispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-07 10:53:19 +02:00
Thomas Citharel
1e390e1982 style(caldav): improve getDenormalizedData method
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-06-27 11:16:47 +00:00
Thomas Citharel
3886b00a33 Fix creating events with old (< unix time) lastoccurence
Closes #20804

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-06-27 11:16:47 +00:00
Christof Arnosti
73fb2997f4 Issue #36644: Fix pruneOutdatedSyncTokens for CalDAV
pruneOutdatedSyncTokens accidentally deletes all entries of the calendarchanges table
instead of leaving $limit elements in the table

Signed-off-by: Christof Arnosti <charno@charno.ch>
2023-06-12 08:35:35 +00:00
Maximilian Martin
c8985944ec fix event move issue
Signed-off-by: Maximilian Martin <maximilian_martin@gmx.de>
2023-04-18 09:45:30 +02:00
Thomas Citharel
ff3b69b21d refactor(dav): Since we're in a transaction, use QB properly when incrementing synctoken
Now that we're in a transaction, we can reuse the sync token's previous value without trouble, and rewrite the increment UPDATE query without dirty direct SQL.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-04-17 16:08:44 +00:00
Thomas Citharel
c9a3129cb4 fix(CalDAV/CardDAV): put every method from Cal/CardDAV backends that does multiple DB calls in transactions
In a lot of methods we're doing read-after-writes (for instance calling
updateProperties after touching calendar objects).
There's also a lot of deleting methods that do stuff sequentially which
could cause trouble.
This should avoid this kind of issues.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-04-17 16:08:44 +00:00
Daniel
c6c512a19d
Merge pull request #34375 from nextcloud/fix/trashbin-uid
fix(dav) Handle Calendar trashbin UID conflicts by removing the deleted calendar object
2023-02-21 16:32:05 +01:00
Anna Larch
5b6a0affd0 Allow reimporting prev. deleted items by deleting trashbin item
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-02-13 15:00:23 +01:00
Christoph Wurst
b5f7afd0fb
fix(caldav): Fix reminder timezone drift for all-day events
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-02-09 15:19:00 +01:00
Côme Chilliet
c4d90f3e81
Removed catch of ValueError as we cannot know if it’s >2038 or <1970
Also fixed numericToString to correctly convert float to int if it fits

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:35 +01:00
Côme Chilliet
d315bce300
Improve behavior with dates on 32bits and fix tests or skip them
We do not support events after 2038 on 32bits but still behave better
 when date range start/end is after 2038.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:32 +01:00
Joas Schilling
1a31ddb56d
Do not reuse query builder objects in DAV account deletion
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-01 21:49:34 +01:00
Anna Larch
e5c290bb7f Switch to DisplayNameCache for CalDAV
Signed-off-by: Anna Larch <anna@nextcloud.com>
2022-11-03 10:26:34 +01:00
Thomas Citharel
6f15873321 Add a background job to prune outdated sync tokens
We remove all outdated sync tokens, based on their auto-incremented ID.

By default we only keep the last 10 000, but this can be configurable.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-10-27 20:12:13 +00:00
Christoph Wurst
e6d8da4cdc Fix causal reads in CalDAV backend
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-03 20:03:29 +02:00
Anna Larch
b044c7586b
Check calendar URI length before creation
Signed-off-by: Anna Larch <anna@nextcloud.com>
2022-08-26 13:57:43 +02:00
Anna Larch
4ca4b02793 Support iMIP invitations from Mail
Signed-off-by: Anna Larch <anna@nextcloud.com>
2022-08-22 22:10:12 +02:00
luz paz
d4637ef4d8 Fix typos in apps/dav subdirectory
Found via `codespell -q 3 -S l10n -L jus ./apps/dav`

Signed-off-by: luz paz <luzpaz@github.com>
2022-07-26 17:40:10 -04:00
Carl Schwan
3598ec4028 Add typing to Sharing Backend
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-22 10:25:17 +02:00
Thomas Citharel
39ef0500d1
Handle the move operation properly between shared calendars
- Introduce a new CalendarObjectMovedEvent typed event dedicated for
  this operation
- Handle the event in the activity backend and add new appropriate activity subjects

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-06-14 14:40:24 +02:00
Vincent Petry
8e61671b82
Merge pull request #32364 from nextcloud/dav-listeners
🧹 Remove all legacy event dispatchers from CalDAV & CardDAV backends
2022-06-10 15:57:35 +02:00
Thomas Citharel
cf8b98bf5f
Make sure activities are not created when a deleted calendar object expires
Closes https://github.com/nextcloud/activity/issues/784

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-05-18 11:17:27 +02:00
Thomas Citharel
060c8d7c4b
Add some typed properties
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-05-17 15:09:49 +02:00
Thomas Citharel
4bb31c021e
Remove all legacy event dispatchers from CalDAV & CardDAV backends
Move them to proper EventListeners and test them

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-05-17 15:09:46 +02:00
Côme Chilliet
e2531f8503
Migrate dav application from ILogger to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-05-02 10:52:43 +02:00