Skip to content

Commit 9203870

Browse files
committed
Do not cache file ids in FileSystemTags
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
1 parent a994ef0 commit 9203870

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

apps/workflowengine/lib/Check/FileSystemTags.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
77
* @author Joas Schilling <coding@schilljs.com>
88
* @author Julius Härtl <jus@bitgrid.net>
9+
* @author Richard Steinmetz <richard@steinmetz.cloud>
910
*
1011
* @license GNU AGPL version 3 or any later version
1112
*
@@ -26,6 +27,7 @@
2627
namespace OCA\WorkflowEngine\Check;
2728

2829
use OCA\Files_Sharing\SharedStorage;
30+
use OCA\GroupFolders\Mount\GroupFolderStorage;
2931
use OCA\WorkflowEngine\Entity\File;
3032
use OCP\Files\Cache\ICache;
3133
use OCP\Files\IHomeStorage;
@@ -131,8 +133,11 @@ protected function getSystemTags() {
131133
* @return int[]
132134
*/
133135
protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
136+
// Do not cache file ids inside group folders because multiple file ids might be mapped to
137+
// the same combination of cache id + path.
138+
$shouldCacheFileIds = !$this->storage->instanceOfStorage(GroupFolderStorage::class);
134139
$cacheId = $cache->getNumericStorageId();
135-
if (isset($this->fileIds[$cacheId][$path])) {
140+
if ($shouldCacheFileIds && isset($this->fileIds[$cacheId][$path])) {
136141
return $this->fileIds[$cacheId][$path];
137142
}
138143

@@ -148,7 +153,9 @@ protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
148153
$parentIds[] = $cache->getId($path);
149154
}
150155

151-
$this->fileIds[$cacheId][$path] = $parentIds;
156+
if ($shouldCacheFileIds) {
157+
$this->fileIds[$cacheId][$path] = $parentIds;
158+
}
152159

153160
return $parentIds;
154161
}

0 commit comments

Comments
 (0)