Skip to content

Commit 6c19fbc

Browse files
committed
fix: adjust authoritative setup path caching logic
Signed-off-by: Salvatore Martire <[email protected]>
1 parent 1829269 commit 6c19fbc

File tree

2 files changed

+503
-5
lines changed

2 files changed

+503
-5
lines changed

lib/private/Files/SetupManager.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function isPathSetup(string $path): bool {
130130

131131
// or if any of the ancestors was fully setup
132132
while (($path = dirname($path)) !== '/') {
133-
$setupPath = $this->setupMountProviderPaths[$path] ?? null;
133+
$setupPath = $this->setupMountProviderPaths[$path . '/'] ?? null;
134134
if ($setupPath === self::SETUP_WITH_CHILDREN) {
135135
return true;
136136
}
@@ -481,8 +481,7 @@ public function setupForPath(string $path, bool $includeChildren = false): void
481481
$rootMetadata = $this->fileAccess->getByFileId($rootId);
482482
$providerArgs = new IMountProviderArgs($cachedMount, $rootMetadata);
483483
// mark the path as cached (without children for now...)
484-
$cacheKey = rtrim($mountPoint, '/');
485-
$this->setupMountProviderPaths[$cacheKey] = self::SETUP_WITHOUT_CHILDREN;
484+
$this->setupMountProviderPaths[$mountPoint] = self::SETUP_WITHOUT_CHILDREN;
486485
$authoritativeMounts[] = array_values(
487486
$this->mountProviderCollection->getUserMountsFromProviderByPath(
488487
$mountProvider,
@@ -558,8 +557,7 @@ public function setupForPath(string $path, bool $includeChildren = false): void
558557
$rootsMetadata[$id] = $fileMetadata;
559558
}
560559
}
561-
$cacheKey = rtrim($mountPoint, '/');
562-
$this->setupMountProviderPaths[$cacheKey] = self::SETUP_WITH_CHILDREN;
560+
$this->setupMountProviderPaths[$mountPoint] = self::SETUP_WITH_CHILDREN;
563561
foreach ($authoritativeCachedMounts as $providerClass => $cachedMounts) {
564562
$providerArgs = array_filter(array_map(
565563
static function (ICachedMountInfo $info) use ($rootsMetadata) {

0 commit comments

Comments
 (0)