fix(ui): Fix email link race with sign up if missing - #9328
Conversation
Follow up fix for #7928 after additional test in staging. With development instances, there can be races between the polling and new email link tabs. These races were made worse by an attempted fix late in the review process on that PR, and although I thought I tested the different flows, I missed cases where the sign up completes immediately without extra requirements ec83f7c Revert that fix, and also add improved redirect handling in the case where the flow completes immediately. This was tested locally against staging and I was no longer able to produce races with dev instances.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 05b94d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughTransferable email-link verification now uses the sign-up-if-missing transfer flow from the sign-in factor card. The verification tab no longer consumes transfers through a local callback. Completed transfers activate the session. Pending tasks use in-component navigation, while terminal redirects use window navigation. Tests cover these flows. Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Follow up fix for #7928 after additional testing in staging.
With development instances, there can be races between the polling and new email link tabs when processing a sign up through the sign-in-or-up flow with strict enumeration protection enabled. Late in the review process on that PR, I added an attempt to avoid these kinds of races, but it was a regression on dev instances when the sign up completes without extra requirements. ec83f7c
Revert that fix, and also add improved redirect handling in the case where the flow completes immediately.
This has the cost that if someone closes the original tab, they are unable to complete the sign up. (That was what we were trying to fix during PR review.) However, there is no easy solution to that problem (and the solution that we attempted to implement to fix it was not successful.) Since email links are so little used, I think we should accept that as a cost for now. If someone closes the original tab, they will just need to start the flow again.
This was tested locally against staging and I was no longer able to produce races with dev instances.
End to end validation I performed on this branch:
Description
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change