Repository navigation
Conversation
Creating a user, or changing a user's email, to an email another user already has hit the unique index, and the error wasn't caught: the page crashed with "Application error: a client-side exception has occurred". The Admin API already answers 409 for this. The form now shows "Another user already has this email." under the email field and keeps what was typed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Creating a user on
/admin/users/new, or changing a user's email, to an email another user already has hit the unique index. The error wasn't caught, and the page crashed with "Application error: a client-side exception has occurred". The Admin API already answers 409 for the same case.The form action now turns that error (
P2002) into a field error, "Another user already has this email.", under the email field, and keeps what was typed. Other errors still fail as before.Evidence
On a local preview, as an admin:
New test for
formSubmit: the taken email becomes a field error on create and on edit, and other errors still throw.tsc --noEmit, ESLint on the changed files andnpm run buildpass.Merge danger
Door: two-way. One form action.
Blast radius: the user create and edit form.
🤖 Generated with Claude Code