Skip to content

perf(sharing): skip resolving group shares when there are none - #65461

Open
CarlSchwan wants to merge 1 commit into
masterfrom
carl/share-skip-empty-group-resolve
Open

CarlSchwan wants to merge 1 commit into
masterfrom
carl/share-skip-empty-group-resolve

Conversation

@CarlSchwan

@CarlSchwan CarlSchwan commented Oct 13, 2026 •

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Skip looking up for the user specific group share entries when no group share was found. This saves a query on every access to a received share for users without group shares for the path.

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@CarlSchwan CarlSchwan added this to the Nextcloud 36 milestone Oct 13, 2026
@CarlSchwan CarlSchwan self-assigned this Oct 13, 2026
@CarlSchwan
CarlSchwan requested a review from a team as a code owner October 13, 2026 10:46
@CarlSchwan
CarlSchwan requested review from come-nc, icewind1991, leftybournes and sorbaugh and removed request for a team October 13, 2026 10:46
Comment thread lib/private/Share20/DefaultShareProvider.php Outdated
Setting up the mount of a received share looks up group shares for the
path, and then queries the user specific group share entries to apply
them, even when no group share was found. The result can only change
the group shares found, so skip the query when there are none. This
saves a query on every access to a received share for users without
group shares for the path.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan
CarlSchwan force-pushed the carl/share-skip-empty-group-resolve branch from 603aa88 to 30853f5 Compare October 13, 2026 19:44
Comment on lines +1074 to 1077
if ($shares2 === []) {
return [];
}
$shares = $this->resolveGroupShares($shares2, $userId, $path, $forChildren);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test should be inside resolveGroupShares, if share list is empty it should early return.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants