From 4077e1e7a292e9960ab41fde223c5a229a7b0c7d Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Wed, 5 Feb 2025 08:49:45 +0100 Subject: [PATCH 1/3] fix(workspace): Use filecache existance for checking if readme exists Signed-off-by: Julius Knorr --- lib/Service/WorkspaceService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/Service/WorkspaceService.php b/lib/Service/WorkspaceService.php index 8bec036a202..40d5a25bb05 100644 --- a/lib/Service/WorkspaceService.php +++ b/lib/Service/WorkspaceService.php @@ -30,9 +30,12 @@ public function __construct(IL10N $l10n) { public function getFile(Folder $folder): ?File { foreach ($this->getSupportedFilenames() as $filename) { try { - $file = $folder->get($filename); - if ($file instanceof File) { - return $file; + $exists = $folder->getStorage()->getCache('')->get($filename); + if ($exists) { + $file = $folder->get($filename); + if ($file instanceof File) { + return $file; + } } } catch (NotFoundException|StorageInvalidException) { continue; From 99382f284a60d96a8c1d30cd1d34161d3d6b9b28 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 7 Feb 2025 12:32:47 +0100 Subject: [PATCH 2/3] fix: Use proper path Signed-off-by: Julius Knorr --- lib/Service/WorkspaceService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/WorkspaceService.php b/lib/Service/WorkspaceService.php index 40d5a25bb05..40e4d439821 100644 --- a/lib/Service/WorkspaceService.php +++ b/lib/Service/WorkspaceService.php @@ -30,7 +30,7 @@ public function __construct(IL10N $l10n) { public function getFile(Folder $folder): ?File { foreach ($this->getSupportedFilenames() as $filename) { try { - $exists = $folder->getStorage()->getCache('')->get($filename); + $exists = $folder->getStorage()->getCache()->get($folder->getInternalPath() . '/' . $filename); if ($exists) { $file = $folder->get($filename); if ($file instanceof File) { From dd47c83f60376b93319d4e3ac036a138ccc948c2 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 7 Feb 2025 12:33:29 +0100 Subject: [PATCH 3/3] fix: Use cached values for empty readme files Signed-off-by: Julius Knorr --- lib/DAV/WorkspacePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DAV/WorkspacePlugin.php b/lib/DAV/WorkspacePlugin.php index 52287825ca8..b7cd454bf1b 100644 --- a/lib/DAV/WorkspacePlugin.php +++ b/lib/DAV/WorkspacePlugin.php @@ -91,7 +91,7 @@ public function propFind(PropFind $propFind, INode $node) { if ($file instanceof File) { $cache = $this->cacheFactory->createDistributed('text_workspace'); $cacheKey = $file->getFileInfo()->getId() . '_' . $file->getFileInfo()->getEtag(); - if ($cachedContent = $cache->get($cacheKey)) { + if (($cachedContent = $cache->get($cacheKey)) !== null) { return $cachedContent; }