diff options
author | Joas Schilling <coding@schilljs.com> | 2024-06-28 10:52:02 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-07-10 14:52:37 +0000 |
commit | ee30cc84385507b538830c4d447b9b8ee2e4ce55 (patch) | |
tree | 45b3be4705e26400816bd2a574d56e3ebb929505 /apps/workflowengine/lib | |
parent | 974fd522e43ade8163f8a3bd7fb9fae9cfc4518a (diff) | |
download | nextcloud-server-ee30cc84385507b538830c4d447b9b8ee2e4ce55.tar.gz nextcloud-server-ee30cc84385507b538830c4d447b9b8ee2e4ce55.zip |
fix(workflows): Fix file systemtag cache
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r-- | apps/workflowengine/lib/Check/FileSystemTags.php | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index ecf0c3471e6..6be818acef7 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -26,7 +26,7 @@ */ namespace OCA\WorkflowEngine\Check; -use OC\Files\Storage\Wrapper\Wrapper; +use OC\Files\Storage\Wrapper\Jail; use OCA\Files_Sharing\SharedStorage; use OCA\WorkflowEngine\Entity\File; use OCP\Files\Cache\ICache; @@ -154,27 +154,15 @@ class FileSystemTags implements ICheck, IFileCheck { * @return int[] */ protected function getFileIds(ICache $cache, $path, $isExternalStorage) { - /** @psalm-suppress InvalidArgument */ - if ($this->storage->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class)) { - // Special implementation for groupfolder since all groupfolders share the same storage - // id so add the group folder id in the cache key too. - $groupFolderStorage = $this->storage; - if ($this->storage instanceof Wrapper) { - $groupFolderStorage = $this->storage->getInstanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class); - } - if ($groupFolderStorage === null) { - throw new \LogicException('Should not happen: Storage is instance of GroupFolderStorage but no group folder storage found while unwrapping.'); - } - /** - * @psalm-suppress UndefinedDocblockClass - * @psalm-suppress UndefinedInterfaceMethod - */ - $cacheId = $cache->getNumericStorageId() . '/' . $groupFolderStorage->getFolderId(); + $cacheId = $cache->getNumericStorageId(); + if ($this->storage->instanceOfStorage(Jail::class)) { + $absolutePath = $this->storage->getUnjailedPath($path); } else { - $cacheId = $cache->getNumericStorageId(); + $absolutePath = $path; } - if (isset($this->fileIds[$cacheId][$path])) { - return $this->fileIds[$cacheId][$path]; + + if (isset($this->fileIds[$cacheId][$absolutePath])) { + return $this->fileIds[$cacheId][$absolutePath]; } $parentIds = []; @@ -189,7 +177,7 @@ class FileSystemTags implements ICheck, IFileCheck { $parentIds[] = $fileId; } - $this->fileIds[$cacheId][$path] = $parentIds; + $this->fileIds[$cacheId][$absolutePath] = $parentIds; return $parentIds; } |