Skip to content

Group creation has delay and allows duplicates#823

Open
rolivares93 wants to merge 9 commits intomainfrom
bug-818/group-creation-delay-and-duplicates
Open

Group creation has delay and allows duplicates#823
rolivares93 wants to merge 9 commits intomainfrom
bug-818/group-creation-delay-and-duplicates

Conversation

@rolivares93
Copy link

@rolivares93 rolivares93 commented Mar 10, 2026

Proposed changes

I refactored both frontend and backend to check for existing orgs. The check now is done by the upsertOrg in the backend.

Screen.Recording.2026-03-10.at.12.28.03.mov

Types of changes

What types of changes does this pull request introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that does not add functionality but makes code cleaner or more efficient)
  • Tests (new or updated tests)
  • Styles (changes to code styling)
  • CI (continuous integration changes)
  • Other (please describe below)

Additional Notes

@rolivares93 rolivares93 self-assigned this Mar 10, 2026
@rolivares93 rolivares93 linked an issue Mar 10, 2026 that may be closed by this pull request
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit e2b267b):

https://hs-levante-admin-dev--pr823-bug-818-group-creati-86uv3q8w.web.app

(expires Tue, 17 Mar 2026 16:12:12 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7889bff1da3bcc333d7422b9fc863c65b3962be7

ui?: EmulatorConnection;
}

const APP_NAME = 'admin';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I had a concern that both levante-firekit and this is using admin as project name. Do you think we should run under different project names? Maybe that's the reason you needed to check if another project was running before?

Copy link
Author

Choose a reason for hiding this comment

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

As far as I know, they have to use the same name app so we can log in with firekit and share the auth to consume the same app's firestore.

@asengupta3
Copy link
Collaborator

Overall these are really great changes since we are getting rid of front end validation changes and relying on backend to do those instead. I just had a concern on the firebase project name. Let's look into that, other than that this is good to merge after a quick test via the preview environment.

@rolivares93 rolivares93 requested a review from asengupta3 March 18, 2026 14:46
Copy link
Member

@fhconte fhconte left a comment

Choose a reason for hiding this comment

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

I approve this PR and left a suggestion on the mutation to add the same duplicate-name check in the backend to prevent duplicates even if the UI is bypassed.

const response = await authStore.roarfirekit.upsertOrg(data);
return response.data;
mutationFn: async (data: CreateOrgType): Promise<void> => {
await groupsRepository.upsertOrg(data);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should add the same duplicate-name check in the backend upsertOrg (e.g. query by normalizedName and throw if it already exists), so duplicates are blocked even if someone bypasses the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Group creation has delay and allows duplicates [PR 813]

3 participants