aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2021-09-14 11:15:26 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-09-14 14:09:50 +0000
commit9983b14318da40d8fe6e2502c22307f15bb46725 (patch)
tree492cbdd0786f432d0339fb4c25c9768cddefd438
parentf26939babb9ca7a2dacd7573e0142b1451f7f984 (diff)
downloadnextcloud-server-9983b14318da40d8fe6e2502c22307f15bb46725.tar.gz
nextcloud-server-9983b14318da40d8fe6e2502c22307f15bb46725.zip
Do not cache file ids in FileSystemTags inside group folders
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
-rw-r--r--apps/workflowengine/lib/Check/FileSystemTags.php11
-rw-r--r--psalm.xml5
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 5ccdb481e17..d51dbb9dde6 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -77,6 +77,11 @@
<file name="build/stubs/xsl.php"/>
</stubs>
<issueHandlers>
+ <UndefinedClass>
+ <errorLevel type="suppress">
+ <referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
+ </errorLevel>
+ </UndefinedClass>
<UndefinedFunction>
<errorLevel type="suppress">
<!-- template functions: https://github.com/nextcloud/server/blob/6e8e34fef920a073118c22111f0f31eb3b3a91dc/lib/private/legacy/template/functions.php -->