perf: Introduce LazyGroup#61871
Open
CarlSchwan wants to merge 2 commits into
Open
Conversation
Similar to LazyUser, this allow to get a IGroup object where properties are lazyly evaluated only when needed. This also reuse the DisplayNameCache from the IGroupManager. Signed-off-by: Carl Schwan <carlschwan@kde.org>
CarlSchwan
commented
Jul 7, 2026
| if ($aGroup instanceof IGroup) { | ||
| $groups[$groupId] = $aGroup; | ||
| } else { | ||
| $this->logger->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', ['app' => 'core']); |
Member
Author
There was a problem hiding this comment.
Not really sure if this can actually happen as it is weird that getUserIdGroupIds would return an invalid group
029a77c to
4e56365
Compare
Signed-off-by: Carl Schwan <carlschwan@kde.org>
4e56365 to
c7075cc
Compare
come-nc
reviewed
Jul 7, 2026
| @@ -0,0 +1,132 @@ | |||
| <?php | |||
|
|
|||
| private function getGroup(): IGroup { | ||
| if ($this->group === null) { | ||
| $this->group = $this->groupManager->get($this->gid); | ||
| ; |
|
|
||
| #[\Override] | ||
| public function setDisplayName(string $displayName): bool { | ||
| return $this->group->setDisplayName($displayName); |
Contributor
There was a problem hiding this comment.
Suggested change
| return $this->group->setDisplayName($displayName); | |
| return $this->getGroup()->setDisplayName($displayName); |
Comment on lines
+127
to
+129
| if ($this->isDeleted === null) { | ||
| $this->getGroup(); | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| if ($this->isDeleted === null) { | |
| $this->getGroup(); | |
| } |
Useless I think, getGroup is called below anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Similar to LazyUser, this allow to get a IGroup object where properties are lazyly evaluated only when needed.
This also reuse the DisplayNameCache from the IGroupManager.
Summary
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)