Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: fix user folder init
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Mar 6, 2024
commit 4fba4cd14ce78e3e0af64a97485a02e47640a144
2 changes: 1 addition & 1 deletion lib/private/Files/Config/UserMountCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function registerMounts(IUser $user, array $mounts, array $mountProviderC

$cachedMounts = $this->getMountsForUser($user);
if (is_array($mountProviderClasses)) {
$cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts) {
$cachedMounts = array_filter($cachedMounts, function (ICachedMountInfo $mountInfo) use ($mountProviderClasses, $newMounts): bool {
// for existing mounts that didn't have a mount provider set
// we still want the ones that map to new mounts
if ($mountInfo->getMountProvider() === '' && isset($newMounts[$mountInfo->getKey()])) {
Expand Down
8 changes: 8 additions & 0 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ public function __construct($params) {
if (isset($params['validateWrites'])) {
$this->validateWrites = (bool)$params['validateWrites'];
}

// home storage is setup in the SetupManager
if (!$this instanceof HomeObjectStoreStorage) {
//initialize cache with root directory in cache
if (!$this->is_dir('/')) {
$this->mkdir('/');
}
}
$this->handleCopiesAsOwned = (bool)($params['handleCopiesAsOwned'] ?? false);

$this->logger = \OCP\Server::get(LoggerInterface::class);
Expand Down
6 changes: 4 additions & 2 deletions lib/private/Files/SetupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ private function oneTimeUserSetup(IUser $user) {

if ($homeMount->getStorageRootId() === -1) {
$this->eventLogger->start('fs:setup:user:home:scan', 'Scan home filesystem for user');
$homeMount->getStorage()->mkdir('');
$homeMount->getStorage()->getScanner()->scan('');
$homeStorage = $homeMount->getStorage();
$homeStorage->mkdir('');
$homeStorage->mkdir('files');
$homeStorage->getScanner()->scan('');
$this->eventLogger->end('fs:setup:user:home:scan');
}

Expand Down