Skip to content

Commit 3aa2112

Browse files
st3inybackportbot[bot]
authored andcommitted
Do not cache file ids in FileSystemTags inside group folders
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
1 parent fefcd86 commit 3aa2112

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

apps/workflowengine/lib/Check/FileSystemTags.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,13 @@ protected function getSystemTags() {
127127
* @return int[]
128128
*/
129129
protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
130+
// TODO: Fix caching inside group folders
131+
// Do not cache file ids inside group folders because multiple file ids might be mapped to
132+
// the same combination of cache id + path.
133+
$shouldCacheFileIds = !$this->storage
134+
->instanceOfStorage(\OCA\GroupFolders\Mount\GroupFolderStorage::class);
130135
$cacheId = $cache->getNumericStorageId();
131-
if (isset($this->fileIds[$cacheId][$path])) {
136+
if ($shouldCacheFileIds && isset($this->fileIds[$cacheId][$path])) {
132137
return $this->fileIds[$cacheId][$path];
133138
}
134139

@@ -144,7 +149,9 @@ protected function getFileIds(ICache $cache, $path, $isExternalStorage) {
144149
$parentIds[] = $cache->getId($path);
145150
}
146151

147-
$this->fileIds[$cacheId][$path] = $parentIds;
152+
if ($shouldCacheFileIds) {
153+
$this->fileIds[$cacheId][$path] = $parentIds;
154+
}
148155

149156
return $parentIds;
150157
}

psalm.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
<file name="build/stubs/xsl.php"/>
4747
</stubs>
4848
<issueHandlers>
49+
<UndefinedClass>
50+
<errorLevel type="suppress">
51+
<referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
52+
</errorLevel>
53+
</UndefinedClass>
4954
<UndefinedFunction>
5055
<errorLevel type="suppress">
5156
<!-- template functions: https://github.com/nextcloud/server/blob/6e8e34fef920a073118c22111f0f31eb3b3a91dc/lib/private/legacy/template/functions.php -->

0 commit comments

Comments
 (0)