Skip to content

Commit d434e7f

Browse files
committed
Do not cache file ids in FileSystemTags inside group folders
Signed-off-by: Richard Steinmetz <[email protected]>
1 parent a994ef0 commit d434e7f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

apps/workflowengine/lib/Check/FileSystemTags.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @author Christoph Wurst <[email protected]>
77
* @author Joas Schilling <[email protected]>
88
* @author Julius Härtl <[email protected]>
9+
* @author Richard Steinmetz <[email protected]>
910
*
1011
* @license GNU AGPL version 3 or any later version
1112
*
@@ -131,8 +132,13 @@ protected function getSystemTags() {
131132
* @return int[]
132133
*/
133134
protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
135+
// TODO: Fix caching inside group folders
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
139+
->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class);
134140
$cacheId = $cache->getNumericStorageId();
135-
if (isset($this->fileIds[$cacheId][$path])) {
141+
if ($shouldCacheFileIds && isset($this->fileIds[$cacheId][$path])) {
136142
return $this->fileIds[$cacheId][$path];
137143
}
138144

@@ -148,7 +154,9 @@ protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
148154
$parentIds[] = $cache->getId($path);
149155
}
150156

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

153161
return $parentIds;
154162
}

0 commit comments

Comments
 (0)