Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve performance of wp mentionable users filter #17872

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

ulferts
Copy link
Contributor

@ulferts ulferts commented Feb 8, 2025

Ticket

https://community.openproject.org/wp/61365

What are you trying to accomplish?

Improve the performance of the Queries::Principals::Filters::MentionableOnWorkPackageFilter which is central for returning the users available when trying to mention somebody in a work package comment. On some SaaS instances, the api/v3/principals endpoint using this filter currently has an impact of 50%.

image

This is caused in part by the filter, when checking for the allowed values fetching the ids of all work packages the requesting user can see.

image

This is done to validate that the filter is not used for probing for information. While this is necessary to be done, it can be done in a more performant way. Instead of fetching all the ids and then comparing those to the filter's values, the filter can check within the DB that the values are within the visible scope using ARs exists? functionality.

This mechanism should be applied to other HugeList filters as well but this is out of scope for this drive by fix.

@ulferts ulferts marked this pull request as ready for review February 10, 2025 09:58
@klaustopher klaustopher self-assigned this Feb 10, 2025
Copy link
Contributor

@klaustopher klaustopher left a comment

Choose a reason for hiding this comment

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

👏

@klaustopher klaustopher merged commit bef6585 into release/15.3 Feb 10, 2025
13 checks passed
@klaustopher klaustopher deleted the fix/improve_mention_user_filter branch February 10, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants