[$175] Wallet-Form not keep the value when close and open "Add detail" again
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.56-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: N/A Email or phone of affected tester (no customers): [email protected] Expensify/Expensify Issue URL: Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: iPhone 16 pro/ 27.2
Action Performed:
Precondition: Login with account that has an Expensify Card and no legal name, date of birth, address or phone number
- Open app
- Go to Account > Wallet
- Tap "Add details"
- Fill the First and last name
- Tap back button
- Tap "Add details"
Expected Result:
Verify the form continues from the step you left with your values kept
Actual Result:
The form opens without the previously entered values
Workaround:
N/A
Platforms:
Select the officially supported platforms where the issue was reproduced:
- [X] Android: App
- [ ] Android: mWeb Chrome
- [X] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [X] Windows: Chrome
- [ ] MacOS: Chrome / Safari
Screenshots/Videos
https://github.com/user-attachments/assets/b6b2ea11-ea47-4f9b-9702-043d02c47551
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022127795064021418642
- Upwork Job ID: 2127795064021418642
- Last Price Increase: 2026-12-01
⚠️ MelvinBot didn't finish that one — the run was killed before I could reply (usually a Cloudflare CPU limit on a long investigation). Please retry with a more specific question, and if this keeps happening post in #melvinbot-ai.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External)
Job added to Upwork: https://www.upwork.com/jobs/~022127795064021418642
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Wallet > Add details (the missing personal details flow for an Expensify Card), if I type my legal first and last name and then tap the back button, the flow closes. When I tap Add details again, the name fields are empty. The form should reopen at the step I left, with the values I typed still there.
What is the root cause of that problem?
The values are saved. The back button on the first step then deletes them.
The Legal name inputs already save a draft on every change (shouldSaveDraft={!isEditing} on both InputWrappers):
https://github.com/Expensify/App/blob/bd19e411d4cd0d2fa4656cb12944949e3495e08e/src/components/SubStepForms/FullNameStep.tsx#L136-L156
When the flow opens again, getSubPageValues reads PERSONAL_DETAILS_FORM_DRAFT first, and getInitialSubPage uses that draft to choose the starting step. So the draft alone would restore both the values and the step:
https://github.com/Expensify/App/blob/bd19e411d4cd0d2fa4656cb12944949e3495e08e/src/pages/MissingPersonalDetails/utils.ts#L12-L26
But the header back handler in MissingPersonalDetailsContent clears the whole form draft before it closes the RHP when the user is on the first step (LEGAL_NAME):
https://github.com/Expensify/App/blob/bd19e411d4cd0d2fa4656cb12944949e3495e08e/src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx#L151-L156
Because of this, the reopened flow has no draft and no saved private details, so it starts on Legal name with empty fields. The same thing happens if the user fills Legal name, DOB, and Address, then taps back step by step to close the flow: on the first step, every draft value from the later steps is deleted too.
This also explains why dismissing the RHP another way (overlay click or Esc on web) keeps the values. Those paths skip handleBackButtonPress, so the draft survives. Only the header back button on step 1 deletes it.
The draft is already cleared at the right time, after the details are actually submitted, in MissingPersonalDetailsValidateCodePage:
https://github.com/Expensify/App/blob/bd19e411d4cd0d2fa4656cb12944949e3495e08e/src/pages/MissingPersonalDetails/MissingPersonalDetailsValidateCodePage.tsx#L76-L82 https://github.com/Expensify/App/blob/bd19e411d4cd0d2fa4656cb12944949e3495e08e/src/pages/MissingPersonalDetails/MissingPersonalDetailsValidateCodePage.tsx#L100-L104
What changes do you think we should make in order to solve the problem?
In MissingPersonalDetailsContent.handleBackButtonPress, remove the clearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM) call from the first-step branch. Back on Legal name should only close the flow (Navigation.closeRHPFlow()). The draft stays until the existing clears on a successful submit in MissingPersonalDetailsValidateCodePage (and the other success paths that already clear it). After this change:
- Reopening Add details shows the typed name, and
getInitialSubPageresumes at the first incomplete step, which is the step the user left. - All dismissal paths behave the same way (back button, overlay, Esc).
Tests: add a case to the MissingPersonalDetails tests. Type into Legal name, press the header back button on step 1, remount the flow, and check that the inputs still hold the typed values. Add a second case: complete Legal name and DOB, back out to close, reopen, and check that the flow starts on Address.
What alternative solutions did you explore? (Optional)
We could keep the clear but call it only when the draft is empty or unchanged. That gives the same result with more code. We could also clear the draft when the card's details are already complete. That isn't needed, because getSubPageValues already falls back to privatePersonalDetails, and the success paths clear the draft.
Note: MelvinBot's run on this issue didn't finish, so it has posted no analysis.
Contributor details
Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01be5d412b545fdf18
Proposal
Please re-state the problem that we are trying to solve in this issue.
In Account > Wallet, when a user taps "Add details", fills in First and Last Name on the Legal Name step, taps the back button to close the flow, and then taps "Add details" again, the form does not keep the entered values and restarts from an empty form.
What is the root cause of that problem?
In src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx (lines 151-156), handleBackButtonPress explicitly clears the form draft when the user is on the first step (CONST.MISSING_PERSONAL_DETAILS.PAGE_NAME.LEGAL_NAME):
if (currentPageName === CONST.MISSING_PERSONAL_DETAILS.PAGE_NAME.LEGAL_NAME) {
clearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM);
Navigation.closeRHPFlow();
return;
}
Calling clearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM) wipes the legalFirstName / legalLastName draft values from Onyx on back press, so reopening "Add details" finds an empty draft instead of restoring the user's input.
What changes do you think we should make in order to solve the problem?
Remove clearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM); from the LEGAL_NAME back-button branch in handleBackButtonPress in src/pages/MissingPersonalDetails/MissingPersonalDetailsContent.tsx, so backing out preserves the draft in ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM (while still clearing the draft upon successful submission).
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
Add/update a unit test for MissingPersonalDetailsContent verifying that:
- Pressing back on the
LEGAL_NAMEstep closes the RHP flow without callingclearDraftValues(ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM). - Reopening the flow restores the previously entered draft values from
ONYXKEYS.FORMS.PERSONAL_DETAILS_FORM.
📣 @wysRocket! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/vladimirkvirenko
⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/vladimirkvirenko
✅ Contributor details stored successfully. Thank you for contributing to Expensify!