fix: clear form errors on valid email submission in forgot password - #13
Closed
ssurendrannair wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a UI bug on the Reset Password (Forgot Password) page where an initial invalid/blank submission left an error banner visible even after a subsequent valid submission succeeded, preventing the success confirmation from rendering correctly.
Changes:
- Clear local error state (
formErrors,validationError) and ReduxemailValidationErrorbefore dispatchingforgotPassword(email)on valid submit. - Add a regression test intended to cover clearing errors on valid resubmission.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/forgot-password/ForgotPasswordPage.jsx | Clears local + Redux validation error state in the valid-submit path before triggering the forgot-password action. |
| src/forgot-password/tests/ForgotPasswordPage.test.jsx | Adds a regression test for the “resubmit with valid email clears prior errors” scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ssurendrannair
requested review from
kramakrushna,
nakhan-sonata-afk and
subhashree-sahu31
July 7, 2026 06:59
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ssurendrannair
force-pushed
the
AUT-145-e-dx-stage-prod-error-message-persists-after-entering-a-valid-email-on-reset-password-page
branch
from
July 7, 2026 07:36
553e43f to
f73b1a2
Compare
Author
|
Duplicate PR |
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.
Here's a PR description for this task:
Summary
On the Reset Password page, when an invalid/blank email was submitted first, the error message ("We were unable to contact you. Enter your email below.") persisted even after a valid email was subsequently submitted and the password reset email was successfully delivered
Fixed by clearing all error states (formErrors, validationError, and Redux emailValidationError) in the else block of handleSubmit before dispatching forgotPassword(email)
The success confirmation alert now renders correctly after a valid submission
Root Cause
ForgotPasswordAlert overrides status to FORM_SUBMISSION_ERROR whenever emailError prop is non-empty. Since formErrors (passed as emailError) was never cleared on a valid submit, the error banner persisted even when the API call succeeded and Redux status became complete.
Changes
Steps to Test
Environment
Stage / Prod