Skip to content
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

Fixes password prompt race condition #4644

Merged
merged 2 commits into from
Sep 21, 2022

Conversation

emrysal
Copy link
Contributor

@emrysal emrysal commented Sep 21, 2022

What does this PR do?

FormMethods is created with default values that can sometimes be "" due to the user not being loaded. Because tests run very fast this can cause the form to be submitted before the default value had a chance to update from the initial draw. When this happens the form value != the email and the password prompt is shown.

@vercel
Copy link

vercel bot commented Sep 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Sep 21, 2022 at 1:47AM (UTC)

bio: user?.bio || "",
},
});
const formMethods = useForm<{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going forward, suspense mode might be a better approach to avoid unnecessary useEffect.

@emrysal emrysal merged commit 52959fe into main Sep 21, 2022
@emrysal emrysal deleted the bugfix/password-prompt-shown-in-test branch September 21, 2022 04:41
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants