Skip to content

Conversation

@icewind1991
Copy link
Member

Add commands to list mounts (both cached and provided) and command to refresh the cached mounts for a user.

primarily intended for helping during authoritative mountpoint debugging, but might be useful outside of it.

@icewind1991 icewind1991 added this to the Nextcloud 33 milestone Nov 14, 2025
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Nov 14, 2025
@icewind1991 icewind1991 requested review from salmart-dev and removed request for ArtificialOwl, nfebe, skjnldsv, susnux and szaimen November 14, 2025 16:44
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good besides one small question

$mounts = $this->mountProviderCollection->getMountsForUser($user);
$mounts[] = $this->mountProviderCollection->getHomeMountForUser($user);
/** @var array<string, IMountPoint> $cachedByMountpoint */
$mountsByMountpoint = array_combine(array_map(fn (IMountPoint $mount) => $mount->getMountPoint(), $mounts), $mounts);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this override mounts that target the same mount points?
Should we make it so that "duplicate" mounts are displayed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, seems like later, you output all the mounts, and cachedMounts, which answers my question :).

But then, could there be a conflict, if two mounts target the same mountPoints, then in the for loops, one cachedMount will win and be displayed for two different mounts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cachedMounts are unique by mountpoint

@icewind1991 icewind1991 merged commit 24df3e7 into master Nov 18, 2025
208 of 216 checks passed
@icewind1991 icewind1991 deleted the mount-commands branch November 18, 2025 21:23
@nextcloud-bot nextcloud-bot mentioned this pull request Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants