Skip to content

Active share validation/authoritative mount improvements#57760

Open
icewind1991 wants to merge 17 commits intomasterfrom
share-update-check-single
Open

Active share validation/authoritative mount improvements#57760
icewind1991 wants to merge 17 commits intomasterfrom
share-update-check-single

Conversation

@icewind1991
Copy link
Member

@icewind1991 icewind1991 commented Jan 23, 2026

  • For events where we know the share, only check/register mount for that share
  • Above a certain number of users, postpone the checks till fs setup time for the user

@icewind1991 icewind1991 added this to the Nextcloud 34 milestone Jan 23, 2026
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Jan 23, 2026
@icewind1991 icewind1991 requested a review from a team as a code owner January 23, 2026 15:03
@icewind1991 icewind1991 requested review from Altahrim, ArtificialOwl, nfebe and salmart-dev and removed request for a team January 23, 2026 15:03
@icewind1991 icewind1991 force-pushed the share-update-check-single branch from b1a28af to 054c5c0 Compare January 23, 2026 15:19
nickvergessen added a commit to nextcloud/spreed that referenced this pull request Jan 23, 2026
…s for new share"

Signed-off-by: Joas Schilling <coding@schilljs.com>
nickvergessen added a commit to nextcloud/spreed that referenced this pull request Jan 23, 2026
…s for new share"

Signed-off-by: Joas Schilling <coding@schilljs.com>
@icewind1991 icewind1991 force-pushed the share-update-check-single branch from 054c5c0 to 3e548a5 Compare January 23, 2026 15:32
@icewind1991 icewind1991 force-pushed the share-update-check-single branch from 3e548a5 to 4851386 Compare February 5, 2026 13:48
nickvergessen added a commit to nextcloud/spreed that referenced this pull request Feb 5, 2026
Signed-off-by: Joas Schilling <coding@schilljs.com>
nickvergessen added a commit to nextcloud/spreed that referenced this pull request Feb 6, 2026
Signed-off-by: Joas Schilling <coding@schilljs.com>
@icewind1991 icewind1991 force-pushed the share-update-check-single branch 2 times, most recently from 000d868 to 716d880 Compare February 9, 2026 15:48
@icewind1991 icewind1991 changed the title fix: only validate mounts for new share Active share validation improvements Feb 12, 2026
@icewind1991 icewind1991 marked this pull request as draft February 12, 2026 14:09
@icewind1991 icewind1991 force-pushed the share-update-check-single branch 2 times, most recently from b35ead2 to 8e50698 Compare February 17, 2026 13:54
@icewind1991 icewind1991 changed the title Active share validation improvements Active share validation/authoritative mount improvements Feb 17, 2026
@icewind1991 icewind1991 force-pushed the share-update-check-single branch 3 times, most recently from f29cc31 to 4b00db9 Compare February 18, 2026 16:00
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

The last commit should be backported as a bug fix


$shares = $this->shareMountProvider->getSuperSharesForUser($user, $ignoreShares);

$mountsChanged = count($shares) !== count($shareMounts);
Copy link
Member

Choose a reason for hiding this comment

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

What does this mean? Should it be set to default, given that the loop might set it to true?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment


try {
$query->executeStatement();
unset($this->mountsForUsers[$user->getUID()]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to reset the mounts for a user when adding a new one?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because otherwise getMountsForUsers will return the old results

Copy link
Contributor

Choose a reason for hiding this comment

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

But can't we only add the new mount?

@icewind1991 icewind1991 force-pushed the share-update-check-single branch from 4b00db9 to 4c18fc1 Compare February 20, 2026 17:13
foreach ($this->shareManager->getUsersForShare($share) as $user) {
if ($share->getSharedBy() !== $user->getUID()) {
$start = floatval($this->clock->now()->format('U.u'));
if ($this->cutOffMarkTime === -1.0 || $this->updatedTime < $this->cutOffMarkTime) {
Copy link
Contributor

@artonge artonge Feb 20, 2026

Choose a reason for hiding this comment

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

So that cutOffMarkTime can be 0 and we can go straight to updating.
By the way, I am not sure whether it makes sense to try to update as many users as possible here instead of flagging them. Do we have more information now compared to later?

Suggested change
if ($this->cutOffMarkTime === -1.0 || $this->updatedTime < $this->cutOffMarkTime) {
if ($this->cutOffMarkTime === -1.0 || $this->updatedTime <= $this->cutOffMarkTime) {

Copy link
Member Author

Choose a reason for hiding this comment

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

So that cutOffMarkTime can be 0 and we can go straight to updating.

This is already the case.

Do we have more information now compared to later?

Yes, for the single-share-add case, possibly in the future for the single-share delete or transfer cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now also for the delete case

Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
…number of users

Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the share-update-check-single branch 2 times, most recently from 61b9ed5 to 356d8f8 Compare February 25, 2026 15:40
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the share-update-check-single branch from 356d8f8 to 4de187a Compare February 25, 2026 15:56
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 marked this pull request as ready for review February 25, 2026 19:56
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