Browse Source

Do not cache file ids in FileSystemTags inside group folders

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
tags/v23.0.0beta1
Richard Steinmetz 2 years ago
parent
commit
8bd8e97181
No account linked to committer's email address
2 changed files with 15 additions and 2 deletions
  1. 10
    2
      apps/workflowengine/lib/Check/FileSystemTags.php
  2. 5
    0
      psalm.xml

+ 10
- 2
apps/workflowengine/lib/Check/FileSystemTags.php View File

@@ -6,6 +6,7 @@
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Joas Schilling <coding@schilljs.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Richard Steinmetz <richard@steinmetz.cloud>
*
* @license GNU AGPL version 3 or any later version
*
@@ -131,8 +132,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];
}

@@ -148,7 +154,9 @@ class FileSystemTags implements ICheck, IFileCheck {
$parentIds[] = $cache->getId($path);
}

$this->fileIds[$cacheId][$path] = $parentIds;
if ($shouldCacheFileIds) {
$this->fileIds[$cacheId][$path] = $parentIds;
}

return $parentIds;
}

+ 5
- 0
psalm.xml View File

@@ -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 -->

Loading…
Cancel
Save