Commit Graph

76 Commits (1e89141c18410a1ed37b694463a90a47d4a0acde)

Author SHA1 Message Date
provokateurin 2c4e5b4187
fixup! fix(UserMountCache): Add back unique index for oc_mounts and use normal insert 2025-12-10 16:32:20 +07:00
provokateurin 91b06a8be0
perf(UserMountCache): Start transaction earlier to prevent unnecessary queries
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-12-09 15:21:50 +07:00
provokateurin 066c10113e
fix(UserMountCache): Add back unique index for oc_mounts and use normal insert
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-12-09 15:21:50 +07:00
Benjamin Gaussorgues 39e2e70084
feat(mounts): optimize load of mounts by filtering on database side
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2025-08-26 08:55:24 +07: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 +07:00
provokateurin 6818aa9b12
feat(UserMountCache): Emit events for added, removed and updated mounts
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-19 13:54:51 +07:00
Robin Appelman c3f06b370c
feat: add debug logging for adding/removing items from the user mounts cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-04-03 17:58:46 +07:00
Git'Fellow a1681b0756 chore(db): Apply query prepared statements
Fix: psalm

fix: bad file

fix: bug

chore: add batch

chore: add batch

chore: add batch

fix: psalm
2024-10-17 20:30:47 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07: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 +07:00
Robin Appelman eb4fb994cf
fix: ensure array returned from getMountsForFileId is continious
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-08-02 17:22:33 +07:00
Robin Appelman 0931492ff0
fix: make usermountcache compatible with sharding
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-17 19:16:05 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +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
Joas Schilling 951c330d39
Revert "don't perform an explicit setup when using the file cache" 2024-03-07 14:38:02 +07:00
John Molakvoæ b7088e7071
Merge pull request #32163 from nextcloud/file-cache-gc-no-full-setup
don't perform an explicit setup when using the file cache
2024-03-07 11:09:19 +07:00
Robin Appelman 4fba4cd14c fix: fix user folder init
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-06 17:52:24 +07:00
Robin Appelman 51019fda7a fix: clearify logic around getMountsForFileId filtering
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-06 10:54:00 +07:00
Robin Appelman e33b32095e Revert "Filter mounts for file id before trying to get user information"
This reverts commit 1e2cf820c8.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-06 10:54:00 +07:00
Robin Appelman 9ea3f4ab8f perf: use lazy user in UserMountCache for getting user for cached mount
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-06 10:53:55 +07:00
Robin Appelman 963721330f only get the path for the users cached mount info when we use it
most of the time we shouldn't need it so we can save joining on the filecache

Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-02-09 09:50:43 +07:00
Robin Appelman b942850af9
optimize UserMountCache::registerStorage
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-16 16:21:59 +07:00
Jonas 7441ce2b11
enh(IMountManager): Add method to get MountPoint from CachedMountInfo
Signed-off-by: Jonas <jonas@freesources.org>
2023-10-23 20:50:24 +07:00
Hamid Dehnavi ea06cf2f39 Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-09-28 17:44:19 +07:00
Faraz Samapoor e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +07:00
Robin Appelman f5e2b0b22f
allow storing multiple mounts for the same rootid in the mount cache
currently `[$userId, $rootId]` is used as the unique key for storing mounts in the mount cache,
however there are cases where the same rootid is mounted in multiple places for a user which currently leads to not all of those mounts being added to the cache.

Previously this didn't matter as the mount cache was only used to list users with access to a specific file, so a user having access to the file multiple times didn' change anything.

With 24 the mount cache is used for more cases and multiple mounts for the same id becomes relevant.
While I think there isn't a real negative effect atm besides missing the optimized path we should ensure that the mounts are properly listed

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-28 15:08:08 +07:00
Joas Schilling 6b0cef6b9a Add transaction around mass mounts operations
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-07 19:58:55 +07:00
Robin Appelman 91d5f6a826 more filesystem setup performance instrumentation
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-10 11:11:13 +07:00
Robin Appelman 10767d7779 fix updating cached mounts that didn't have their mount provider set previously
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:47:41 +07:00
luz paz 368f83095d Fix typos in lib/private subdirectory
Found via `codespell -q 3 -S l10n -L jus ./lib/private`

Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 +07:00
Carl Schwan d5c23dbb9f Move CappedMemoryCache to OCP
This is an helpful helper that should be used in more place than just
server and this is already the case with groupfodlers, deck, user_oidc
and more using it, so let's make it public

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 15:54:31 +07:00
Carl Schwan ec6b83cc18 Add stricter psalm type for CappedMemoryCache
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-12 15:06:18 +07:00
Joas Schilling 49e62149d8
Make the binary operation order explicit
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-21 10:47:26 +07:00
Côme Chilliet 765999f454
Merge pull request #31609 from nextcloud/fix/migrate-away-from-ilogger
Migrate from ILogger to LoggerInterface in lib/private
2022-03-29 09:39:38 +07:00
Robin Appelman 1179873f33
add comment for getMountForPath loop
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:36:59 +07:00
Robin Appelman 63ad99ba4a
fix method name
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:04:01 +07:00
Robin Appelman 506d29c095
update cached mounts when only specific providers have been setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:55 +07:00
Robin Appelman 04052a9594
allow getting cached mounts by path from the mount cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:12 +07:00
Côme Chilliet 6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +07:00
Robin Appelman cfb7923e08
store mountprovider for each mount in the mounts table
this enabled more fine grained filesystem setup

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-23 18:02:33 +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
Julius Härtl 1e2cf820c8
Filter mounts for file id before trying to get user information
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-04-30 07:55:38 +07:00
dependabot-preview[bot] eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +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
Joas Schilling 8027dcbc6f
Don't leave cursors open when tests fail
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 12:28:17 +07:00
Morris Jobke 99c9423766
Remove @suppress SqlInjectionChecker
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-16 15:53:56 +07:00
Christoph Wurst 1f7f93a695
Update license headers for Nextcloud 20 (again)
There are still lots of outdated headers, so time for another round of
updates.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-09-07 14:37:44 +07:00
Julius Härtl ac2999a26a
Transfer shares of the transferred root node
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-31 14:23:34 +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
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +07:00