-
Notifications
You must be signed in to change notification settings - Fork 101
fix: resolve race condition in Clerk auth signup flow to prevent duplicate login attempts #3325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…icate login attempts
…of user.update behavior
| @@ -1,5 +1,6 @@ | |||
| Released Jazz 0.19.16: | |||
| - Improved sync timeout error messages to include known state, peer state, and any error information when waiting for sync times out | |||
| - Bugfix: fixed a race condition in Clerk auth where the signup flow could trigger a duplicate login attempt | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? I thought our release process took care of updating this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it only updates the individual changelogs in each package.
The result is unreadable, and can't be used when publishing on discord, so I've started to manually keep track of the changes to release here.
| private previousUser: Pick< | ||
| NonNullable<MinimalClerkClient["user"]>, | ||
| "unsafeMetadata" | ||
| > | null = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd extract the repeated type into a named type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to clean up the module, there is a bit of unnecessary code that's here for tech debt.
Going to do it in a follow-up PR, so I can release this fix ASAP.
While debugging an issue I've found that when signing up with Clerk the user also goes through the logIn flow, creating a new context and interrupting the previous sync ops.