Do not cache file ids in FileSystemTags inside group folders

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
pull/28833/head
Richard Steinmetz 3 years ago committed by backportbot[bot]
parent fefcd8652a
commit 3aa21120bc

@ -127,8 +127,13 @@ class FileSystemTags implements ICheck, IFileCheck {
* @return int[] * @return int[]
*/ */
protected function getFileIds(ICache $cache, $path, $isExternalStorage) { 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(); $cacheId = $cache->getNumericStorageId();
if (isset($this->fileIds[$cacheId][$path])) { if ($shouldCacheFileIds && isset($this->fileIds[$cacheId][$path])) {
return $this->fileIds[$cacheId][$path]; return $this->fileIds[$cacheId][$path];
} }
@ -144,7 +149,9 @@ class FileSystemTags implements ICheck, IFileCheck {
$parentIds[] = $cache->getId($path); $parentIds[] = $cache->getId($path);
} }
$this->fileIds[$cacheId][$path] = $parentIds; if ($shouldCacheFileIds) {
$this->fileIds[$cacheId][$path] = $parentIds;
}
return $parentIds; return $parentIds;
} }

@ -46,6 +46,11 @@
<file name="build/stubs/xsl.php"/> <file name="build/stubs/xsl.php"/>
</stubs> </stubs>
<issueHandlers> <issueHandlers>
<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="OCA\GroupFolders\Mount\GroupFolderStorage"/>
</errorLevel>
</UndefinedClass>
<UndefinedFunction> <UndefinedFunction>
<errorLevel type="suppress"> <errorLevel type="suppress">
<!-- template functions: https://github.com/nextcloud/server/blob/6e8e34fef920a073118c22111f0f31eb3b3a91dc/lib/private/legacy/template/functions.php --> <!-- template functions: https://github.com/nextcloud/server/blob/6e8e34fef920a073118c22111f0f31eb3b3a91dc/lib/private/legacy/template/functions.php -->

Loading…
Cancel
Save