Commit graph

143 commits

Author SHA1 Message Date
Carl Schwan
4d47fdaa85 chore: Run rector with new rules for fetch
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-11-18 17:45:57 +01:00
Christoph Wurst
21d28c887a
Merge pull request #54424 from nextcloud/fix/dav/user-addressbook-clean-up
fix(dav): clean up user's addressbook shares on deletion
2025-09-02 20:18:27 +02:00
Richard Steinmetz
4cf2203de8
perf(carddav): ungreedify search result aggregation
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2025-09-01 12:06:48 +02:00
Christoph Wurst
8e1a070bd5
fix(dav): clean up user's addressbook shares on deletion
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2025-09-01 10:37:08 +02:00
Daniel Kesselberg
13f25c9316 fix(carddav): return correct sync token for non-truncated requests
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-08-06 14:32:25 +02:00
Hamza Mahjoubi
36d9fcbb4d feat(cardav): support result truncation for addressbook federation
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
2025-08-06 14:04:55 +02:00
SebastianKrupinski
49d8e29a18 fix: do not ignore move command object target uri
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
2025-08-01 09:36:07 -04:00
Daniel Kesselberg
0f4b5e6656
Revert "fix(dav): only consider user's principal for unsharing entries"
This reverts commit 023b98c44b.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-07-09 16:06:12 +02:00
Ferdinand Thiessen
5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
Daniel
daa9852722
Merge pull request #52215 from nextcloud/perf/carddav/dont-query-circles
perf(carddav): don't query circle memberships
2025-06-01 19:57:13 +02:00
Daniel Kesselberg
023b98c44b
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-05-14 09:03:33 +02:00
Richard Steinmetz
de37af9687
perf(carddav): don't query circle memberships
It is not possible to share address books with circles so it is
pointless to query for address books shared with joined circles.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2025-04-16 10:04:01 +02:00
Christoph Wurst
0bb68ab734 fix(carddav): Handle race for SAB creation better
* Accept non repeatable read and INSERT conflict by another read
* Handle replication edge case

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-11-06 09:13:01 +01:00
Git'Fellow
c254855222 chore(db): Correctly apply query types
fix: psalm

fix: error

fix: add batch

fix: fatal error

fix: add batch

chore: add batch

chore: add batch

fix: psalm

fix: typo

fix: psalm

fix: return bool

fix: revert Manager
2024-10-17 09:21:07 +02:00
Côme Chilliet
1a4978c4ea
chore: Apply rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-20 17:51:00 +02:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02: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 +02:00
Andy Scherzinger
9d4b944098
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-27 20:11:22 +02: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 +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
09031211da
fix(dav): Fix atomic addressbook update
Sabre executes the proppatch callback *after* calling updateAddressbook
and not synchronously. That means the code inside the callback was run
outside a database transaction. This moves the atomic helper into the
callback to create the expected transaction span.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-02-29 09:27:49 +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
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Christoph Wurst
5cdbd10327
refactor(caldav): Use even earlier return and SQL's WHERE IN
* Early return can operate on the input array
* SQL can check be used to check for address book ID inclusion

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-11-15 14:48:55 +01:00
hamza221
26ee5a531b
feat(search): allow contacts person search
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-11-14 18:29:42 +01:00
Benjamin Gaussorgues
ddb8b68b55
feat(carddav): Allow advanced search for contacts
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-10 09:21:16 +01:00
Christoph Wurst
9627176a23
Merge pull request #38610 from fsamapoor/replace_strpos_calls_in_dav_app
Refactors "strpos" calls in /apps/dav
2023-09-17 10:14:20 +02:00
Anna Larch
6bd78917d3 fix(CardDAV): set owner-principal, displayname properties for SAB
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-08-16 09:11:01 +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
Faraz Samapoor
bbfe2fb821
Merge branch 'master' into replace_strpos_calls_in_dav_app
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-27 19:07:09 +03:30
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
Faraz Samapoor
0bae21b1d1 Refactors "strpos" calls in /apps/dav to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-12 09:46:07 +02:00
Thomas Citharel
13a3ebd4cc
feat(CardDAV): Add Sabre\DAV\IMoveTarget support to OCA\DAV\CardDAV\AddressBook
This allows to just UPDATE the card row instead of deleting it and reinsert it. It's very similar to https://github.com/nextcloud/server/pull/30120 for calendars.

As we need the addressbookid exposed, this introduces OCA\DAV\CardDAV\Card that extends Sabre's.

I chose specifically NOT to auto-inject LoggerInterface in Addressbook like in #30120 because the chain of DI is huge just for ONE simple call and it would break an existing dirty call (OCA\Contacts calling OCA\DAV) of ContactsManager in Contacts: https://github.com/nextcloud/contacts/pull/1722 (in SocialApiService), but this is debatable.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-05-16 11:38:57 +02:00
Anna Larch
5c2eb732f1 fix(carddav): expose system address book
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-05-11 18:59: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
jld3103
7e58aa1a05
Fix DAV types
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-04-05 07:06:50 +02: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
9dd51601c6 Switch to DisplayNameCache for CardDAV
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
19b7dad3dc Wrap address book creation write-read in a transaction
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2022-10-03 17:48:52 +02:00
Joas Schilling
d41841b4a7
Check address book URI length before creation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-08-26 13:58:18 +02:00
Anna Larch
61b55c88da performance optimisation for carddav backend blob data read
Signed-off-by: Anna Larch <anna@nextcloud.com>
2022-08-15 20:47:58 +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
6114176b71 Cleanup CardDav SyncService
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-24 20:25:38 +02: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
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
Carl Schwan
07c9bf1adf
Merge pull request #31943 from nextcloud/dav-cleanup
Cleanup dav
2022-05-17 14:59:59 +02:00
Carl Schwan
f7be76125f Fix more psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-16 11:05:54 +02:00