-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Group performance improvements #15665
Merged
Merged
Conversation
This file contains 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
…ions synchronous to avoid re-fetching groups repeatedly.
…perf-improvements
…perf-improvements
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
samwho
approved these changes
Mar 4, 2025
…perf-improvements
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
The primary purpose of this PR is to introduce two functions,
isCreatorSync
andisCreatorAsync
- the first takes a list of groups and determines if the user is a creator, including checking the groups and the second will retrieve the groups and check the user (only taking the user as a parameter).This is useful as there are many places where lots of users need to be assessed to check if they are a creator, in this case its better to retrieve a list of all the groups that pertained to those users and then synchronously checking the users against the groups - previously when this was necessarily the list of groups would be retrieved over and over again.
The existing group test cases confirm this doesn't affect the functionality of the system - the reason the async function exists is really as a utility incase you are doing this for a single user, you still need the full list of groups that pertain to them, this function encapsulates that logic for situations like middlewares where it needs to check a single user.
Pro PR: https://github.com/Budibase/budibase-pro/pull/356