Commit Graph

226 Commits (f2ff14e6a4d0d0daa12201c00a2e128068b69453)

Author SHA1 Message Date
Daniel Kesselberg 4c13ef7f0d
fix(dav): only consider user's principal for unsharing entries
Before: Find all entries in `dav_shares` with `access = 5` for the user's principal, as well as group and circle memberships.

After: Find all entries in `dav_shares` with `access = 5` solely for the user's principal.

Future support for unsharing group or circle principals could be considered as a feature enhancement.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-06-01 16:39:43 +07:00
Daniel Kesselberg d0871f6cdc
fix(caldav): prevent unshare entry creation for owner unsharing
- Introduces a `unshare` method in `CalDavBackend` to handle user unshares.
- Implements check to determine if unshare entry is needed based on group/circle membership.
- Ensures `updateShares` is only used when the calendar owner manages shares.
- Resolves issue where unsharing a calendar as owner created an unshare entry in `oc_dav_shares`.

Related PRs:
- https://github.com/nextcloud/server/pull/43117
- https://github.com/nextcloud/server/pull/47737

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-06-01 16:39:43 +07:00
Ferdinand Thiessen 832f79ac93
chore: apply code style
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-30 19:04:59 +07:00
SebastianKrupinski f64ad8a452 fix: do not ignore move command object target uri
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
2025-04-30 14:27:57 +07:00
Richard Steinmetz 11f444e34f fix: improve oci compatibility when purging calendar invitations
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2024-11-25 17:03:15 +07:00
Richard Steinmetz 87fd9434ee fix: invalid usage of IQueryBuilder::createNamedParameter()
And fix a typo: chunck -> chunk

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2024-11-25 17:03:15 +07:00
SebastianKrupinski ea484ec6d2 fix: (CalDav) Delete invitation when deleting Calendars or Events
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
2024-11-21 14:34:07 +07:00
Luc Didry f83cebf79e fix(dav): catch `MaxInstancesExceededException` on calendar events
Signed-off-by: Luc Didry <luc@didry.org>
2024-09-16 14:34:29 +07:00
Anna Larch e9e4bacbfd fix(caldav): limit property length
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-08-22 11:22:43 +07:00
Richard Steinmetz b8ec68d212
Merge pull request #46723 from nextcloud/feat/add-delta-sync-to-subscription-calendars
feat(webcal): only update modified and deleted events from webcal calendars
2024-08-14 08:57:03 +07:00
Richard Steinmetz 82615ce868
fix(caldav): allow VJOURNAL if no supported component set is specified
This is mandated by the RFCs.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2024-08-13 15:26:17 +07:00
Anna Larch fb94db1cd9 feat(webcal): only update modified and deleted events from webcal calendars
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-08-13 13:05:58 +07:00
SebastianKrupinski a56d0dbf4b fix(caldav): fixed initial sync and double processing
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
2024-08-01 13:20:47 +07:00
Joas Schilling eeb6ddb176
fix(db): Deprecate `IExpressionBuilder::or()` and `IExpressionBuilder::and()` without parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:16 +07:00
SebastianKrupinski 0f3d05afea fix(caldav): Throw 403 Forbidden Error instead of 500 Internal Server Error
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
2024-07-17 17:42:35 +07:00
Anna Larch ad78f7e48e fix(caldav): automatically delete outdated scheduling objects
Signed-off-by: Anna Larch <anna@nextcloud.com>
2024-05-31 13:14:01 +07:00
Daniel Kesselberg b769dc4304 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-05-28 19:56:36 +07:00
Daniel Kesselberg 4718a7e4e0 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-05-28 19:56:36 +07:00
Andy Scherzinger 9d4b944098
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-27 20:11:22 +07:00
Daniel Kesselberg e210043ee9
feat(caldav): expose calendar subscriptions
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-05-07 16:03:33 +07:00
Côme Chilliet ab6afe0111 fix: Fix new psalm errors from update
Not sure about the SimpleContainer modification, let’s see what CI says
 about that.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-08 11:29:09 +07:00
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Richard Steinmetz ace08819f9
fix(dav): expand recurrences when searching
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2023-09-21 23:28:35 +07:00
Robin Appelman 30e9f520f3
Merge pull request #39568 from nextcloud/caldav-share-preload
Calendar optimizations
2023-08-14 10:27:35 +07: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 +07: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 +07:00
Robin Appelman 7c02eedabb
cache calendar objects from calendarQuery
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-07-26 14:36:39 +07: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 +07: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 +07: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 +07: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 +07:00
Thomas Citharel 1e390e1982 style(caldav): improve getDenormalizedData method
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-06-27 11:16:47 +07: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 +07: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 +07:00
Maximilian Martin c8985944ec fix event move issue
Signed-off-by: Maximilian Martin <maximilian_martin@gmx.de>
2023-04-18 09:45:30 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00