You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Paid] [$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account #72754
Version Number: v9.2.32-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/test-runs/TR-1309/folder/13176687/41236707/955761858?sort=-identifier Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Device used: Mac 15.4.1 Safari, Desktop, iPhone 13 iOS 18.6.2 Safari, Hybrid App Component: User Settings
What changes do you think we should make in order to solve the problem?
Inside clearError, we shouldn't call clearUnvalidatedNewContactMethodAction. Rather we should call clearPendingContactActionErrors since we only want to clear the error.
What alternative solutions did you explore? (Optional)
Optionally we can move clearContactMethod call and Navigation.goBack(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo)) above !pendingContactAction?.contactMethod check
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
When the user tries to dismiss the error or click back, both callbacks check if pendingContactAction?.contactMethod exists and return early if it doesn't
Please re-state the problem that we are trying to solve in this issue.
Users who try to add a contact method that already exists see the red error banner but cannot dismiss it or leave the flow. The X button and the back button do nothing, leaving the right-hand pane stuck open.
What is the root cause of that problem?
The clearError and onClose handlers inside NewContactMethodConfirmMagicCodePage short-circuit when pendingContactAction?.contactMethod is empty, which happens after the server tells us the contact already exists. Because the rest of the handler never runs, neither the pending action nor the navigation gets cleared, so the UI stays frozen.
What changes do you think we should make in order to solve the problem?
Update NewContactMethodConfirmMagicCodePage so we always clear the pending action and navigate away, while only removing the optimistic login record when it actually belongs to this flow.
changed the title [-]Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/-][+][$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/+]on Oct 20, 2025
changed the title [-][$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/-][+][Due for payment] [$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/+]on Nov 27, 2025
changed the title [-][Due for payment] [$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/-][+][Paid] [$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/+]on Nov 27, 2025
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Test 1
Navigate to Account Settings > Profile > Contact Methods
Select "New Contact Method."
Enter an already registered email
Enter the correct magic code
Tap on close button
Verify that the error is cleared
Test 2
Navigate to Account Settings > Profile > Contact Methods
Select "New Contact Method."
Enter an already registered email
Enter the correct magic code
Tap on back button
Verify that you are navigated back
Test 3
Navigate to Account Settings > Profile > Contact Methods
Select "New Contact Method."
Enter an already registered email
Enter the correct magic code
Clear the magic code
Verify that the error message is cleared
Test 4
Navigate to Account Settings > Profile > Contact Methods
Select "New Contact Method."
Enter a new email
Enter the correct magic code
Enter a correct magic code sent to the newly added contact method
Verify that the contact method is added successfully
Test 5
Go to Setting
Security
Add copilot
Select User
Select Access Level
Click Add copilot
Request magic code until “Failed to send a new magic code. Please wait a bit and try again.” Error is displayed
Click on close button
Verify that the error is cleared
Test 6
Precondition: You have added a copilot
Go to Setting
Go to Security
Add copilot
Click on the copilot
Click on Change access level
Request magic code until “Failed to send a new magic code. Please wait a bit and try again.” error is displayed
Click on close button
Verify that the error is cleared
Test 7
Precondition: You have set up Expensify card
Go to a workspace settings
Go to Expensify card
Select any card type
Fill all required fields until you reach the verification page
Request magic code until “Failed to send a new magic code. Please wait a bit and try again.” error is displayed
Activity
melvin-bot commentedon Oct 16, 2025
Triggered auto assignment to @RachCHopkins (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.etCoderDysto commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Contact methods - The Back and error dismiss buttons do not respond when adding existing account
What is the root cause of that problem?
We call
clearErrorwhen validating magic code, andclearUnvalidatedNewContactMethodActionwill be called and it will clearpendingContactActiondataApp/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx
Lines 225 to 229 in 825fb54
App/src/pages/settings/Profile/Contacts/NewContactMethodConfirmMagicCodePage.tsx
Lines 58 to 63 in 825fb54
Then we return early when we call onClose and clearError that makes back button and error clear button un responsive
App/src/pages/settings/Profile/Contacts/NewContactMethodConfirmMagicCodePage.tsx
Lines 58 to 71 in 825fb54
What changes do you think we should make in order to solve the problem?
Inside clearError, we shouldn't call clearUnvalidatedNewContactMethodAction. Rather we should call clearPendingContactActionErrors since we only want to clear the error.
App/src/pages/settings/Profile/Contacts/NewContactMethodConfirmMagicCodePage.tsx
Lines 58 to 60 in 825fb54
What alternative solutions did you explore? (Optional)
Optionally we can move clearContactMethod call and Navigation.goBack(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo)) above !pendingContactAction?.contactMethod check
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
nyomanjyotisa commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Contact methods - The Back and error dismiss buttons do not respond when adding existing account
What is the root cause of that problem?
The
successDatafromaddNewContactMethodsetsPENDING_CONTACT_ACTION.contactMethodtonullApp/src/libs/actions/User.ts
Lines 386 to 404 in 5c27729
When the user tries to dismiss the error or click back, both callbacks check if
pendingContactAction?.contactMethodexists and return early if it doesn'tApp/src/pages/settings/Profile/Contacts/NewContactMethodConfirmMagicCodePage.tsx
Lines 58 to 72 in 5c27729
Since
contactMethodisnull, both callbacks return early without clearing the error or navigating back, making the buttons appear unresponsiveWhat changes do you think we should make in order to solve the problem?
Remove the
pendingContactAction?.contactMethodchecks from both callbacks. We should always allow the user to dismiss errors and navigate backApp/src/pages/settings/Profile/Contacts/NewContactMethodConfirmMagicCodePage.tsx
Lines 58 to 72 in 5c27729
What alternative solutions did you explore? (Optional)
None
ShridharGoel commentedon Oct 16, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Users who try to add a contact method that already exists see the red error banner but cannot dismiss it or leave the flow. The X button and the back button do nothing, leaving the right-hand pane stuck open.
What is the root cause of that problem?
The
clearErrorandonClosehandlers insideNewContactMethodConfirmMagicCodePageshort-circuit whenpendingContactAction?.contactMethodis empty, which happens after the server tells us the contact already exists. Because the rest of the handler never runs, neither the pending action nor the navigation gets cleared, so the UI stays frozen.App/src/pages/settings/Profile/Contacts/NewContactMethodConfirmMagicCodePage.tsx
Lines 52 to 71 in f8e2af1
What changes do you think we should make in order to solve the problem?
Update
NewContactMethodConfirmMagicCodePageso we always clear the pending action and navigate away, while only removing the optimistic login record when it actually belongs to this flow.This keeps existing contact methods in place while letting the user close the modal, restoring both the dismiss button and the back button.
[-]Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/-][+][$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/+]melvin-bot commentedon Oct 20, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021980420509630047828
melvin-bot commentedon Oct 20, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (
External)12 remaining items
dukenv0307 commentedon Nov 24, 2025
@RachCHopkins Can you please process the payment?
[-][$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/-][+][Due for payment] [$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/+]RachCHopkins commentedon Nov 27, 2025
Payment Summary:
Upwork job here
RachCHopkins commentedon Nov 27, 2025
@etCoderDysto you have been paid!
@dukenv0307 can you do the checklist please?
[-][Due for payment] [$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/-][+][Paid] [$250] Contact methods - The Back and error dismiss buttons do not respond when adding existing account[/+]dukenv0307 commentedon Nov 28, 2025
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/58934/files#r2570442102
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Test 1
Test 2
Test 3
Test 4
Test 5
Test 6
Precondition: You have added a copilot
Test 7
Precondition: You have set up Expensify card
Do we agree 👍 or 👎
dukenv0307 commentedon Nov 28, 2025
@RachCHopkins I completed the checklist. Thank you
twisterdotcom commentedon Dec 2, 2025
@dukenv0307 has submitted payment for this report on ND here.
SO: https://stackoverflowteams.com/c/expensify/questions/7582
Zapier Logs
Run ID: 00040eee-3f5e-a32e-a7ac-633ce01ff794melvin-bot commentedon Dec 4, 2025
@RachCHopkins Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
twisterdotcom commentedon Dec 5, 2025
Okay, Rach is out but you can request payment now @dukenv0307