Skip to content

fix: handle concurrent OTP signup email unique race - #2686

Open
rohanpatel2002 wants to merge 1 commit into
supabase:masterfrom
rohanpatel2002:fix/otp-concurrent-signup-race
Open

fix: handle concurrent OTP signup email unique race#2686
rohanpatel2002 wants to merge 1 commit into
supabase:masterfrom
rohanpatel2002:fix/otp-concurrent-signup-race

Conversation

@rohanpatel2002

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Concurrent POST /otp for the same new email can hit users_email_partial_key and return a raw 500 (unexpected_failure / aborted transaction).

Fixes #2675

What is the new behavior?

Unique email conflicts during signup are detected and retried once on the existing-user path, so the losing request returns 200 like a normal retry.

Additional context

Shared fix in signupNewUser / Signup (covers MagicLink OTP and direct signup). Includes a concurrent OTP regression test.

Detect users_email_partial_key conflicts during signup and retry once
on the existing-user path so /otp returns 200 instead of a raw 500.

Fixes supabase#2675
@rohanpatel2002
rohanpatel2002 requested a review from a team as a code owner August 7, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant