From 3aa21120bc539bf4b31f54067769991fecd9fd41 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Tue, 14 Sep 2021 11:15:26 +0200 Subject: [PATCH] Do not cache file ids in FileSystemTags inside group folders Signed-off-by: Richard Steinmetz --- apps/workflowengine/lib/Check/FileSystemTags.php | 11 +++++++++-- psalm.xml | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index 530509608a1..d4c97723aac 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -127,8 +127,13 @@ class FileSystemTags implements ICheck, IFileCheck { * @return int[] */ protected function getFileIds(ICache $cache, $path, $isExternalStorage) { + // TODO: Fix caching inside group folders + // Do not cache file ids inside group folders because multiple file ids might be mapped to + // the same combination of cache id + path. + $shouldCacheFileIds = !$this->storage + ->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class); $cacheId = $cache->getNumericStorageId(); - if (isset($this->fileIds[$cacheId][$path])) { + if ($shouldCacheFileIds && isset($this->fileIds[$cacheId][$path])) { return $this->fileIds[$cacheId][$path]; } @@ -144,7 +149,9 @@ class FileSystemTags implements ICheck, IFileCheck { $parentIds[] = $cache->getId($path); } - $this->fileIds[$cacheId][$path] = $parentIds; + if ($shouldCacheFileIds) { + $this->fileIds[$cacheId][$path] = $parentIds; + } return $parentIds; } diff --git a/psalm.xml b/psalm.xml index f299558450d..2858b448904 100644 --- a/psalm.xml +++ b/psalm.xml @@ -46,6 +46,11 @@ + + + + +