Skip to content

Send addressStreet2 as a separate param in AddPersonalBankAccount - #104823

Open
MelvinBot wants to merge 2 commits into
mainfrom
claude-sendAddressStreet2InAddPersonalBankAccount
Open

MelvinBot wants to merge 2 commits into
mainfrom
claude-sendAddressStreet2InAddPersonalBankAccount

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

When you add a US personal bank account with Address Line 2, addPersonalBankAccount joined both lines with \n into addressStreet. The API rejects newlines in that field, so the whole address was lost and the Wallet row showed Review.

This PR sends the two lines as separate params, the same way updatePersonalBankAccountInfo already does:

  • addressStreet: Line 1
  • addressStreet2: Line 2, or '' when empty

The backend now accepts addressStreet2 on AddPersonalBankAccount (already on staging, per the issue). It stores the address as line1\nline2, which the App already splits for display, so no read-side change is needed.

Changes:

  • src/libs/actions/BankAccounts.ts: send addressStreet and addressStreet2 separately in addPersonalBankAccount.
  • src/libs/API/parameters/AddPersonalBankAccountParams.ts: add addressStreet2.
  • tests/unit/BankAccountsTest.ts: add tests for both params, with and without Line 2.

AI tests run locally: BankAccountsTest and AddPersonalBankAccountPageTest pass, plus typecheck, lint-changed, oxfmt, and spell-changed. An automated web UI check could not run because the test browser session rendered a blank page, so the end-to-end flow still needs manual verification on staging.

Fixed Issues

$ #104165
PROPOSAL: #104165 (comment)

Tests

  1. Open Account > Wallet > Add bank account > Get reimbursed (if shown) > United States > Next > Connect manually.
  2. Leave bank fields empty and select Next: This field is required appears; setup cannot advance. Complete the form with 123 Main St / Apt 4B and the required US address fields.
  3. Confirm; reconfirm if the staging ownership error appears. Verify Personal bank account added!, then Continue. Verify the bank is Active where shown, without Review.
  4. Reload/relaunch and verify persistence. On desktop, verify both address lines in the fresh OpenPaymentsPage response.
  5. Repeat with a different bank account and Line 2 empty. Verify no undefined or extra address line after reload.
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline at confirmation: You appear to be offline., Confirm disabled, no bank added.
  2. Reconnect, confirm and reload. Verify the address persists without a duplicate bank.

QA Steps

Same as Tests and Offline 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 verified any copy / text that was added to the app 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 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 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
PR-104823-android-native-online.mp4
Android: mWeb Chrome
PR-104823-android-mweb-chrome-online-final.mp4
iOS: Native
PR-104823-ios-native-online-final.mp4
iOS: mWeb Safari
PR-104823-ios-mweb-safari-online-final.mp4
MacOS: Chrome / Safari
PR-104823-desktop-web-chrome-online.mp4

@MelvinBot
MelvinBot requested a review from a team October 23, 2026 08:28
@melvin-bot melvin-bot Bot added Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web labels Oct 23, 2026
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I created this PR from an upstream branch since I don't have push access to your fork.

To take ownership of this branch and be able to push updates, run:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-sendAddressStreet2InAddPersonalBankAccount
git checkout -b claude-sendAddressStreet2InAddPersonalBankAccount upstream/claude-sendAddressStreet2InAddPersonalBankAccount
git push -u origin claude-sendAddressStreet2InAddPersonalBankAccount

Then you can close this PR and open a new one from your fork.

@MelvinBot

MelvinBot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ❌ fail

I reached Wallet > Add bank account, but the flow opens a "Validate your account" magic-code screen first. I can't read the code from the test account's email inbox, so I couldn't reach the address page or check the Line 1/Line 2 fix. The PR's Tests section is still empty, so I used the steps from the linked issue.
Validate your account magic-code panel after clicking Add bank account

Step Status
Navigate to Account > Wallet > Add bank account; the add bank account flow opensWallet loaded. Clicking "Add bank account" opened a "Validate your account" magic-code panel instead of the country step. The placeholder code 123456 was rejected.
Validate your account magic-code panel after clicking Add bank account
✅
Select United States and click NextNot reached. Blocked by the account validation screen.
❌
Connect manually and enter routing/account numbersNot reached. Blocked by the account validation screen.
❌
Enter Address Line 1 and Address Line 2 on the "What's your address?" pageNot reached. Blocked by the account validation screen.
❌
Complete the remaining required fieldsNot reached. Blocked by the account validation screen.
❌
AddPersonalBankAccount sends addressStreet = Line 1 and addressStreet2 = Line 2, and succeedsNot reached. The request was never sent.
❌
The new US bank account shows in Wallet without a "Review" label, with Line 1 and Line 2 savedNot reached. No bank account was added.
❌

These failures mean the steps were blocked, not that the fix is broken. To test it, use an account that is already validated. The unit tests in tests/unit/BankAccountsTest.ts cover both params.


view run · view recording

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing test (job 8) check is unrelated to this PR, so I didn't push a fix. Check independent approval only needs a reviewer approval.

Analysis: The failing test is EditMerchantRulePage route guard › fetches the rules collection when it is reached without one loaded in tests/ui/EditMerchantRulePageGuardTest.tsx:150. It expects a GetRules read call. This PR only changes the AddPersonalBankAccount params and its unit test.

Evidence:

  • PR files: src/libs/API/parameters/AddPersonalBankAccountParams.ts, src/libs/actions/BankAccounts.ts, tests/unit/BankAccountsTest.ts. None touch workspace rules.
  • The branch is up to date with main (0 commits behind).
  • The same test failed with the same assertion today on [HOLD] Open a member's unreported expense from Search as an admin, which changes only Search and Report files.

Next step: Re-run the failed job. If it keeps failing, the flaky test needs a separate fix on main.

@MelvinBot

MelvinBot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ❌ fail

I couldn't test the Address Line 2 fix on Android. Tapping "Add bank account" opens a "Validate your account" magic-code screen, the same blocker as on Web. The code goes to the test account's email, which I can't read. The PR's Tests section is still empty, so I used the steps from the linked issue.
Validate your account magic-code screen blocking Add bank account

Step Status
Navigate to Account > Wallet > Add bank account; the add bank account flow opensAccount > Wallet showed the Bank accounts section with an "Add bank account" button. Tapping it left the Wallet list screen.
✅
Select United States, connect manually, enter Address Line 1 and Line 2, complete required fields, and submitNot reached. Tapping "Add bank account" opened a "Validate your account" screen asking for a 6-digit code sent to the test account's email.
Validate your account magic-code screen blocking Add bank account
❌
The new US bank account shows in Wallet without a "Review" label, with Line 1 and Line 2 savedNot reached. No bank account was added.
❌

These failures mean the steps were blocked, not that the fix is broken. To test the fix, use an account that is already validated.


view run · view recording

@nyomanjyotisa

Copy link
Copy Markdown
Member

@MelvinBot please replace ### Tests onward with:

PR description update

Tests

  1. Open Account > Wallet > Add bank account > Get reimbursed (if shown) > United States > Next > Connect manually.
  2. Leave bank fields empty and select Next: This field is required appears; setup cannot advance. Complete the form with 123 Main St / Apt 4B and the required US address fields.
  3. Confirm; reconfirm if the staging ownership error appears. Verify Personal bank account added!, then Continue. Verify the bank is Active where shown, without Review.
  4. Reload/relaunch and verify persistence. On desktop, verify both address lines in the fresh OpenPaymentsPage response.
  5. Repeat with a different bank account and Line 2 empty. Verify no undefined or extra address line after reload.
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline at confirmation: You appear to be offline., Confirm disabled, no bank added.
  2. Reconnect, confirm and reload. Verify the address persists without a duplicate bank.

QA Steps

Same as Tests and Offline 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 verified any copy / text that was added to the app 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 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 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
PR-104823-android-native-online.mp4
Android: mWeb Chrome
PR-104823-android-mweb-chrome-online-final.mp4
iOS: Native
PR-104823-ios-native-online-final.mp4
iOS: mWeb Safari
PR-104823-ios-mweb-safari-online-final.mp4
MacOS: Chrome / Safari
PR-104823-desktop-web-chrome-online.mp4

@MelvinBot

Copy link
Copy Markdown
Contributor Author

I replaced everything from ### Tests onward in the PR description with your text. That covers Tests, Offline tests, QA Steps, the PR Author Checklist, and Screenshots/Videos. The sections above it, from the reviewer note through Fixed Issues, are unchanged.


view run

@nyomanjyotisa

Copy link
Copy Markdown
Member

@MelvinBot please mark this PR ready for review.

@MelvinBot
MelvinBot marked this pull request as ready for review October 23, 2026 16:33
@MelvinBot
MelvinBot requested a review from a team as a code owner October 23, 2026 16:33
@MelvinBot

Copy link
Copy Markdown
Contributor Author

I marked this PR as ready for review.


view run

@melvin-bot
melvin-bot Bot requested a review from nyomanjyotisa October 23, 2026 16:33
@melvin-bot

melvin-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

@nyomanjyotisa 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 flaviadefaria and removed request for a team October 23, 2026 16:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T16:38:58.939533Z 735eca7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@nyomanjyotisa

Copy link
Copy Markdown
Member

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 any copy / text that was added to the app 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 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 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
PR-104823-android-native-online.mp4
Android: mWeb Chrome
PR-104823-android-mweb-chrome-online-final.mp4
iOS: HybridApp
PR-104823-ios-native-online-final.mp4
iOS: mWeb Safari
PR-104823-ios-mweb-safari-online-final.mp4
MacOS: Chrome / Safari
PR-104823-desktop-web-chrome-online.mp4

@nyomanjyotisa

Copy link
Copy Markdown
Member

@puneetlath While reviewing this PR, I discovered the international-bank terms checkbox has no accessible name. Confirmed on staging and main; changing aria-label to accessibilityLabel restores the name because that is the prop CheckboxWithLabel expects. The full fix, including a regression test, is 19 changed lines. May I handle this separately under the C+ small-fix process?

@nyomanjyotisa nyomanjyotisa left a comment

Copy link
Copy Markdown
Member

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 puneetlath October 24, 2026 09:00
@MelvinBot
MelvinBot requested a review from a team as a code owner October 24, 2026 09:09
@melvin-bot
melvin-bot Bot requested review from nyomanjyotisa and removed request for a team October 24, 2026 09:10
@melvin-bot

melvin-bot Bot commented Oct 24, 2026

Copy link
Copy Markdown

@nyomanjyotisa 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]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The failing test (job 8) check is a flaky test from main, not this PR's changes. I merged main into this branch so the next run includes the fix.

What failed: tests/ui/EditMerchantRulePageGuardTest.tsx, the test "fetches the rules collection when it is reached without one loaded". It expected a GetRules call but got 0 calls. This PR only changes AddPersonalBankAccountParams.ts, BankAccounts.ts, and BankAccountsTest.ts.

What I did: I pushed merge commit 35052fa. After the merge, the diff against main is still only this PR's 3 files.

Details
  • The failed run started at 08:29 UTC on Oct 23. Main fixed this test leak afterward in 7d8f07e ("Stop GetRules leaking between EditMerchantRulePage guard tests", 09:37 UTC) and 10292b2 (16:37 UTC).
  • I could not run jest in my environment, so the new CI run will confirm the result.
  • Check independent approval is also failing. That check is expected until a reviewer approves the PR.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The test checks now pass on the latest commit (35052fa), including test (job 8). No further fix is needed.

The only failing check is Check independent approval. It will pass once a reviewer approves the PR. branch-perf-tests is still running.

@nyomanjyotisa

Copy link
Copy Markdown
Member

@puneetlath I also found this while reviewing this PR: Wallet → Add personal card → Next without a country → select United States. The country error remains, although Next advances.

The country selector should clear hasError when a country is selected, like the personal-bank and company-bank selectors. May I handle this separately under the C+ small-fix process?

Chrome-F26-before.mp4

This branch has not been deployed

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

Labels

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants