fix: make sure all mounts are setup in getById

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2026-01-29 16:33:27 +01:00
parent 2f2a8fac61
commit 02cf3d7c89
No known key found for this signature in database
GPG key ID: 42B69D8A64526EFB

View file

@ -405,6 +405,7 @@ class Root extends Folder implements IRootFolder {
*/
public function getByIdInPath(int $id, string $path): array {
$mountCache = $this->getUserMountCache();
$setupManager = $this->mountManager->getSetupManager();
if ($path !== '' && strpos($path, '/', 1) > 0) {
[, $user] = explode('/', $path);
} else {
@ -414,7 +415,7 @@ class Root extends Folder implements IRootFolder {
// if the mount isn't in the cache yet, perform a setup first, then try again
if (count($mountsContainingFile) === 0) {
$this->mountManager->getSetupManager()->setupForPath($path, true);
$setupManager->setupForPath($path, true);
$mountsContainingFile = $mountCache->getMountsForFileId($id, $user);
}
@ -436,11 +437,7 @@ class Root extends Folder implements IRootFolder {
}, $mountsContainingFile));
$mountRoots = array_combine($mountRootIds, $mountRootPaths);
$mounts = $this->mountManager->getMountsByMountProvider($path, $mountProviders);
$mountsContainingFile = array_filter($mounts, function ($mount) use ($mountRoots) {
return isset($mountRoots[$mount->getStorageRootId()]);
});
$mountsContainingFile = array_filter(array_map($this->mountManager->getMountFromMountInfo(...), $mountsContainingFile));
if (count($mountsContainingFile) === 0) {
if ($user === $this->getAppDataDirectoryName()) {