Skip to content

Collect legal name and address before creating a wallet deposit account. - #102944

Merged
marcochavezf merged 4 commits into
Expensify:mainfrom
neerajbachani:100075-wallet-add-bank-account-address
Oct 8, 2026
Merged

marcochavezf merged 4 commits into
Expensify:mainfrom
neerajbachani:100075-wallet-add-bank-account-address

Conversation

@neerajbachani

@neerajbachani neerajbachani commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Enable Wallet was creating the Plaid deposit account before a legal name and address existed, then KYC asked for the same details again.

This change collects legal name and a US address in the Enable Wallet > Add bank account flow, after Plaid and before confirmation, and sends them with AddPersonalBankAccount. The address step is the wallet US address form (state picker and ZIP, no country picker). A complete US name and address already on the wallet draft, saved wallet details, or private profile is skipped. Those values are written into the wallet draft on submit, so the later KYC personal-info step does not ask for them again, including when date of birth is still missing. Phone stays on KYC. The standalone Add bank account flow and Corpay are unchanged.

Fixed Issues

$ #100075
PROPOSAL: #100075 (comment)

Tests

  1. Sign in with a US account that has not enabled the wallet and has no personal bank account.
  2. Open Settings > Wallet > Enable wallet > Add bank account.
  3. Connect a bank in the Plaid sandbox and select an account.
  4. Verify the next steps are Legal name, then Address, and that the address step has no country picker.
  5. Enter a legal first name, last name, and complete US address.
  6. Verify confirmation shows the legal name and address.
  7. Confirm and verify the AddPersonalBankAccount request includes the legal name and address.
  8. Continue into KYC personal info and verify legal name and address are not asked again.
  • Verify that no errors appear in the JS console

Offline tests

  1. Reach Legal name in Enable wallet > Add bank account, then turn the network off.
  2. Enter a legal name and US address and continue to confirmation.
  3. Verify the name and address are still shown.
  4. Press confirm. Verify the form keeps the entered name and address.
  5. Turn the network back on and verify the name and address are still present on confirmation.

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-10-05.at.2.16.27.PM.online-video-cutter.com.mp4
Android: mWeb Chrome
Record_2026-10-05-16-05-28.online-video-cutter.com.mp4
iOS: Native
Screen.Recording.2026-10-05.at.1.53.20.PM.online-video-cutter.com.mp4
iOS: mWeb Safari
Screen.Recording.2026-10-05.at.1.59.46.PM.online-video-cutter.com.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-10-05.at.1.37.33.PM.online-video-cutter.com.mp4

Enable Wallet was creating the Plaid account before owner details existed, and KYC asked for the same name and address again.
@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

@neerajbachani
neerajbachani marked this pull request as ready for review October 5, 2026 10:47
@neerajbachani
neerajbachani requested review from a team as code owners October 5, 2026 10:47
@melvin-bot
melvin-bot Bot requested review from huult and removed request for a team October 5, 2026 10:47
@melvin-bot

melvin-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

@huult Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from trjExpensify and removed request for a team October 5, 2026 10:47
Comment thread src/pages/EnablePayments/Wallet/utils/getBankAccountOwnerDetails.ts
@neerajbachani

Copy link
Copy Markdown
Contributor Author

@codex review

@trjExpensify trjExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. CC: @nkuoch @coleaeason for vis

@huult

huult commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot review this

@MelvinBot

Copy link
Copy Markdown
Contributor

Code review

The approach makes sense. I found three problems to fix before merge.

1. Skipping the address page bypasses the wallet's address validation. getBankAccountOwnerDetails.ts:96-100 treats an address as complete when the four fields are non-empty. The wallet address form also rejects PO boxes and mail drops, and checks the US ZIP format. Skipped pages never run those checks. Two ways this goes wrong:

  • The profile address form doesn't block PO boxes. Only AddPersonalBankAccountPage turns on shouldValidatePhysicalAddress. A profile PO box address skips the page and goes to AddPersonalBankAccount and to KYC.
  • usedWalletForm sets the country to US if any one field came from the wallet draft. Example: a Canadian profile address, and the user changed only the state to TX before going back. The page is skipped, and the request sends Toronto, TX M5V 1A1 as a US address.

Fix: run the same street (getInvalidAddressErrorTranslationPath) and ZIP (isValidZipCode) checks before setting hasAddress.

2. skipPages changes while the user fills in a page, which breaks Back. AddBankAccount.tsx:117 and PersonalInfo.tsx:57 work out skipPages from the wallet draft on every render. FormProvider saves that draft on each keystroke. After the user enters a legal name, LEGAL_NAME is added to skipPages. Back from Address then goes to Plaid, and Back from Confirmation skips both new pages (prevPage). KYC has the same problem: once the address is filled in, Back from Phone skips Address. Fix: work out skipPages once when the flow mounts, for example with a useState initializer.

3. A two-line street is written into a single-line field. getWalletOwnerDraftValues stores displayStreet, which looks like 123 Main St\nApt 4, as the wallet addressStreet. The wallet address step uses AddressSearch, a single-line input. On web, the browser strips the line break, so the user sees 123 Main StApt 4 when they edit the address. UpdatePersonalDetailsForWallet also receives a street with \n for the first time. Consider storing only line 1 in the wallet draft, or confirm the backend accepts \n here.

Minor
  • ConfirmationStep.tsx:80 now also shows name and address when you revisit an account that was already added. Those values come from the current draft and profile, not from the bank account. For accounts added before this change, the rows may be blank or not match what's on file. Consider hiding the rows when isBankAccountAdded is true.
  • The unit tests cover only the resolver. None of them cover the skip and Back behavior from item 2.

A live skip list was jumping past pages the user had just completed, and a non-empty profile address could skip the PO box and ZIP checks.
@huult

huult commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Tag me when it's ready

@neerajbachani

Copy link
Copy Markdown
Contributor Author

@huult Ready for another look. The follow up commit covers the melvin review comment: skipped addresses now require a physical street and a valid US ZIP, skipPages stays fixed after load so Back remains on the page just filled, the wallet draft stores a single-line street, and the name and address rows are hidden when the account was already added.

@huult

huult commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-10-06.at.14.30.24.mov
Android: mWeb Chrome
Screen.Recording.2026-10-06.at.14.34.21.mov
iOS: HybridApp
Screen.Recording.2026-10-06.at.14.47.55.mov
iOS: mWeb Safari
Screen.Recording.2026-10-06.at.14.50.37.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-06.at.14.25.41.mov

Comment thread src/pages/EnablePayments/Wallet/utils/getBankAccountOwnerDetails.ts
A PO box or non-US profile address was being copied into the KYC draft even though that address is not complete enough to skip.
@neerajbachani

Copy link
Copy Markdown
Contributor Author

@huult Thanks for the review and suggestion! I've updated the changes in the latest commit

@huult

huult commented Oct 6, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-10-06.at.14.53.59.mov

LGTM. CC: @nkuoch @coleaeason for vis

@nkuoch @coleaeason, could you review the video included after the changes, or trigger an adhoc build to review the changes?

@huult

huult commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@nkuoch @coleaeason, #102944 (comment) what do you think?

@huult

huult commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@nkuoch @coleaeason, #102944 (comment) what do you think?

Maybe they’re both busy and haven’t had a chance to review it, so we can let them review it after the deploy.

@huult huult left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@melvin-bot
melvin-bot Bot requested a review from marcochavezf October 8, 2026 03:27
@marcochavezf
marcochavezf merged commit 82c3f92 into Expensify:main Oct 8, 2026
35 of 39 checks passed
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🚧 marcochavezf has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

OSBotify commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify OSBotify mentioned this pull request Oct 8, 2026
90 tasks done
@OSBotify

OSBotify commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/marcochavezf in version: 9.5.6-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. This PR stops Enable Wallet from asking for your legal name and address twice. Set Up Your Wallet still correctly lists the details you enter during setup, and the standalone Add bank account flow in Connect a Personal Bank Account is unchanged.


view run

@OSBotify

OSBotify commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.6-6 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants