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

Group performance improvements #15665

Merged
merged 17 commits into from
Mar 11, 2025
Merged

Conversation

mike12345567
Copy link
Collaborator

@mike12345567 mike12345567 commented Mar 3, 2025

Description

The primary purpose of this PR is to introduce two functions, isCreatorSync and isCreatorAsync - 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

@mike12345567 mike12345567 self-assigned this Mar 3, 2025
Copy link

qa-wolf bot commented Mar 3, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/m labels Mar 3, 2025
@mike12345567 mike12345567 marked this pull request as ready for review March 4, 2025 17:01
@mike12345567 mike12345567 requested a review from a team as a code owner March 4, 2025 17:01
@mike12345567 mike12345567 requested review from samwho and removed request for a team March 4, 2025 17:01
@mike12345567 mike12345567 merged commit cd29131 into master Mar 11, 2025
22 checks passed
@mike12345567 mike12345567 deleted the fix/group-perf-improvements branch March 11, 2025 13:56
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants