Skip to content

perf(group): Cache group membership in distributed cache - #62581

Open
CarlSchwan wants to merge 4 commits into
masterfrom
carl/cache-group-membership
Open

perf(group): Cache group membership in distributed cache#62581
CarlSchwan wants to merge 4 commits into
masterfrom
carl/cache-group-membership

Conversation

@CarlSchwan

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

And move the group management listener registration in the core app instead of the files_sharing app (which can be disabled).

TODO

  • ...

Checklist

AI (if applicable)

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

@CarlSchwan CarlSchwan added this to the Nextcloud 35 milestone Jul 27, 2026
@CarlSchwan CarlSchwan self-assigned this Jul 27, 2026
@CarlSchwan
CarlSchwan requested a review from a team as a code owner July 27, 2026 13:42
@CarlSchwan
CarlSchwan requested review from Altahrim, icewind1991, provokateurin and salmart-dev and removed request for a team July 27, 2026 13:42
@CarlSchwan
CarlSchwan force-pushed the carl/cache-group-membership branch 5 times, most recently from c948aff to 056a23d Compare July 27, 2026 18:43
And move the group management listener registration in the core app
instead of the files_sharing app (which can be disabled).

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Not used anymore in github.com/nextcloud and there is a modern
replacement since NC 18

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan
CarlSchwan force-pushed the carl/cache-group-membership branch from 056a23d to 3dca2f3 Compare July 31, 2026 08:40
}

#[\Override]
public function handle(Event $event): void {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is unexpected to have logic here. Shouldn't we have a dedicated listener for that?

Comment on lines +386 to +397
public function handle(Event $event): void {
if ($event instanceof BeforeGroupDeletedEvent) {
unset($this->cachedGroups[$event->getGroup()->getGID()]);
$this->cachedUserGroups->clear();
$this->cachedUserGroupsLocal = [];
}

if ($event instanceof BeforeUserAddedEvent || $event instanceof BeforeUserRemovedEvent) {
$this->cachedUserGroups->remove($event->getUser()->getUID());
unset($this->cachedUserGroupsLocal[$event->getUser()->getUID()]);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same for that listener handle, shouldn't we have a dedicated file for that?

Comment thread lib/private/SubAdmin.php
Comment on lines +257 to 266
public function handle(Event $event): void {
if ($event instanceof GroupDeletedEvent) {
$this->postDeleteGroup($event->getGroup());
}

if ($event instanceof UserDeletedEvent) {
$this->postDeleteUser($event->getUser());
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same

@nextcloud-bot nextcloud-bot mentioned this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants