Group creation has delay and allows duplicates#823
Conversation
|
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'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
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. |
fhconte
left a comment
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
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?
Additional Notes