perf(system_tags): Optimize system tag activity recipient resolution for file mapper events#59931
Open
mosi-kha wants to merge 1 commit intonextcloud:masterfrom
Open
perf(system_tags): Optimize system tag activity recipient resolution for file mapper events#59931mosi-kha wants to merge 1 commit intonextcloud:masterfrom
mosi-kha wants to merge 1 commit intonextcloud:masterfrom
Conversation
…ng redundant calls and improving node resolution logic
Contributor
Author
|
@ArtificialOwl @icewind1991 @nfebe @sorbaugh |
Member
|
Conflict a bit with #58602 |
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.
Summary
systemtagsactivity handling forMapperEvent::EVENT_ASSIGN/EVENT_UNASSIGNcurrently resolves recipients by iterating all mounts returned bygetMountsForFileId()and repeatedly callinggetPathsForAccessList()for the same file event.Listener::mapperEvent()because access-list expansion is recomputed many times.getPathsForAccessList()once, and reuses that user-path map for activity publishing.Problem
mapperEvent()did per-mount:getPathsForAccessList(node)getPathsForAccessList()already performs access-list expansion for the file node, so per-mount repetition is redundant and scales poorly with mount count.Solution
$node->getOwner()+ ownergetById()), to use canonical share/access context.getPathsForAccessList()once, assign$users = $al['users'], and stop iterating.Why this is safe
filesobject type, non-empty tags, assign/unassign events, activity app enabled).updateLastUsedTagsbehavior).Performance impact (measured example)
Test plan
Notes for reviewers
getPathsForAccessList()call is sufficient.