From 8bd8e9718181aedfd2da9ebded1baea66d97f8f4 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 | 12 ++++++++++-- psalm.xml | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index b69f7492e02..a879a8e1703 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -6,6 +6,7 @@ * @author Christoph Wurst * @author Joas Schilling * @author Julius Härtl + * @author Richard Steinmetz * * @license GNU AGPL version 3 or any later version * @@ -131,8 +132,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]; } @@ -148,7 +154,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 5ccdb481e17..d51dbb9dde6 100644 --- a/psalm.xml +++ b/psalm.xml @@ -77,6 +77,11 @@ + + + + +