Commit Graph

85 Commits (f2ff14e6a4d0d0daa12201c00a2e128068b69453)

Author SHA1 Message Date
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 a56d0dbf4b fix(caldav): fixed initial sync and double processing
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
2024-08-01 13:20:47 +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 56d4f3aa2d
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-28 14:41:28 +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
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
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
Côme Chilliet 8857599656
DateRangeError in PHP>=8.3 is not a ValueError anymore
Fixing 32bit CI on PHP>=8.3

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-14 16:28:28 +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 5ad24991d7 Issue #36644: Test cases
Signed-off-by: Christof Arnosti <charno@charno.ch>
2023-06-05 20:40:34 +07:00
Côme Chilliet 476d5dceb2
Skip tests that cannot succeed on 32bits
For some reason a timestamp in the past also triggers the PHP error
 about not being able to represent it as an int, so skipping that test
 on 32bits.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:34 +07: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 +07:00
Christoph Wurst 898d2923cc
chore(dav): Add void return type to test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-01-20 08:38:43 +07: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 +07:00
luz paz 9d26671f05 Fix typos in apps/ subdirectory
Found via `codespell -q 3 -S l10n,./apps/files_external/3rdparty -L adn,ba,boxs,keypair,jus,optionel,ressource,tabel ./apps/`

Signed-off-by: luz paz <luzpaz@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-09-05 12:59:54 +07: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 +07: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 +07: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 +07:00
Anna Larch 0745fc5012 Move calendar objects between calendars instead of deleting and recreating them
Signed-off-by: Anna Larch <anna@nextcloud.com>
2022-03-16 12:48:50 +07:00
Morris Jobke 92d19bd79b
Merge pull request #27374 from nextcloud/bugfix/noid/adjust-unit-tests
Bugfix/noid/adjust unit tests
2021-06-07 11:12:22 +07:00
Morris Jobke e238b93234
Code style fixes
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-06-07 10:31:14 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Joas Schilling e1e5026df2
Fix dispatcher handling in CalDavBackendTest
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-04 10:57:41 +07:00
Christoph Wurst d6d8e9215c
Add a trashbin for calendars and calendar objects
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-31 07:49:19 +07:00
Christoph Wurst cebe951b8e
Remove the untyped calendar update event
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-07 17:09:37 +07:00
Christoph Wurst 884e34b12a
Remove the untyped calendar create event
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-07 16:58:33 +07:00
Christoph Wurst 257613e6ef
Remove the \OCA\DAV\CalDAV\CalDavBackend::createCalendarObject event
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-07 12:13:45 +07:00
Christoph Wurst f808267949
Remove the \OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject event
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-07 12:10:58 +07:00
Christoph Wurst d512a5629e
Remove the \OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject event
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-07 10:53:45 +07:00
Christoph Wurst 63eb3694e4
Exclusively use the typed calendar deletion events for DAV
We had both in places, but the old one isn't used anywhere outside this
app, so it's time to migrate the code.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-04-29 15:31:19 +07:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
leith abdulla a40a307b65 handle vcalander documents with recurrence with exemptions or edits
when importing ics files from third party services (ex: google), long
running recurrence vcalander objects can contain numerous vevents
relating to past exemptions or edits.

these objects are handled incorrectly, leading to incorrect first and/or
last occurence dates from being inferred. as a result, a number of
imported events are not rendered in the calendar.

this PR makes use of EventIterator's constructor that takes in an array
of VEVENTS to properly handle these complex cases.

Also of note is that other parameter signatures of EventIterator's constructor,
will be deprecated, according to comments in sabre dav EventIterator.php

Signed-off-by: leith abdulla <online-nextcloud@eleith.com>
2020-10-28 21:07:00 +07:00
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +07:00
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +07:00
Georg Ehrke 67f1ef4658
Add Typed Events for CalDAV- and CardDAV-related Events
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-08-18 21:40:57 +07:00
Morris Jobke 234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-12 13:55:19 +07:00
Georg Ehrke 900617e7d7
Add Event and Task Backends for Unified Search
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-08-04 16:01:59 +07:00
Morris Jobke 7e6c0ec284
Use assertEqualsCanonicalizing instead of deprecated assertEquals parameter
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-23 17:11:29 +07:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +07:00
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +07:00
Christoph Wurst 2fbad1ed72
Fix (array) indent style to always use one tab
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 10:16:08 +07:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +07:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +07:00
Christoph Wurst 2ee65f177e
Use the shorter phpunit syntax for mocked return values
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:21:27 +07:00
Thomas Citharel 01db6d4609
Add extra test case to exclude by timerange
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-03-22 14:24:13 +07:00
dartcafe b0fbba05f2
Added test testSearch
Signed-off-by: dartcafe <github@dartcafe.de>
2020-03-22 14:24:13 +07:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00