Skip to content

[$175] Bank account - Address line is not saved when adding an US bank account #104165

Open

Description

@applause-bot

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.10-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/78924832/folder/57527124/41236750/1865570868?sort=%2Bidentifier
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Web
App Component: User Settings

Action Performed:

Preconditions:

  1. Use expensifail account

Steps:

  1. Navigate to Account > Wallet > Add bank account
  2. Select United States and click Next
  3. Connect manually to the bank account
  4. In the "What’s your address?" page, add any info in Adress Line 2
  5. Complete all the required fields
  6. Complete the flow to add the bank account

Expected Result:

Address fields should be saved when adding the bank account.

Actual Result:

After creating the bank account, a Review label is visible in the added US bank account row, address is not being saved.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

_To b

Bug7287485_1792088932580.ExpensifyBAAdressNotSaved.mp4

e added by Applause Leads_

View all open jobs on GitHub

Applause Internal Information
Exported by: Chandana Kiran
Bug ID: 7287485

Issue OwnerCurrent Issue Owner: @nyomanjyotisa
Upwork Automation - Do Not Edit

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 15, 2026
  2. applause-bot commented on Oct 15, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/29331da153ada80b72719bfe2f52b155a3747d2d1e894dfb24d1d776552948ba

  3. MelvinBot commented on Oct 15, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    addPersonalBankAccount joins Address Line 1 and Line 2 with a newline and sends them as one addressStreet value (for example, "123 Main St\nApt 4"). It never sends addressStreet2 on its own. See BankAccounts.ts:564 and PersonalDetailsUtils.ts:319.

    We already know this field rejects newlines. [No QA] Send addressStreet2 as separate param in UpdatePersonalBankAccountInfo found this for the update flow and fixed it by sending addressStreet2 separately. The add flow was never changed.

    Without a saved street, isPersonalBankAccountMissingInfo returns true, and the row shows Review.

    What changes do you think we should make in order to solve the problem?

    1. In addPersonalBankAccount, send addressStreet as Line 1 only and add a separate addressStreet2 param. Match how updatePersonalBankAccountInfo does it.
    2. Add addressStreet2?: string to AddPersonalBankAccountParams.ts.
    3. Add a unit test that checks the API params when Line 2 is filled.

    This fixes both callers: the manual/Plaid flow in AddPersonalBankAccountPage and the Enable Wallet flow in EnablePayments/Wallet/AddBankAccount.

    Before merging: an internal engineer should confirm that the AddPersonalBankAccount backend command reads addressStreet2, as UpdatePersonalBankAccountInfo does. If it doesn't, the backend needs a change too.

    What alternative solutions did you explore? (Optional)

    Strip or replace the newline in the frontend, for example by joining with ", ". I don't recommend this: it doesn't match how the backend stores the two lines for the update flow.

    Investigation details

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104165) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 15, 2026
  5. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @nyomanjyotisa (External)

  6. changed the title [-]Bank account - Address line is not saved when adding an US bank account[/-] [+][$175] Bank account - Address line is not saved when adding an US bank account[/+] on Oct 15, 2026
  7. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  8. janiya2 commented on Oct 15, 2026

    @janiya2

    Contributor details
    Your Expensify account email: [email protected]
    Upwork Profile Link: https://www.upwork.com/freelancers/janithad

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When adding a US bank account (either via Plaid or manual connection) and entering an Address with Address Line 2 (addressStreet2), the address is not properly saved, causing a "Review" badge to appear on the newly created bank account row.


    What is the root cause of that problem?

    1. In src/libs/actions/BankAccounts.ts (addPersonalBankAccount):

    In src/libs/actions/BankAccounts.ts:564, addPersonalBankAccount constructs the API parameters by joining addressStreet and addressStreet2 with a newline via getFormattedStreet:

    addressStreet: getFormattedStreet(account?.addressStreet, account?.addressStreet2),

    getFormattedStreet formats the street as:

    function getFormattedStreet(street1 = '', street2 = '') {
        return `${street1}\n${street2}`;
    }

    This causes addressStreet to contain a newline (\n), while addressStreet2 is omitted from parameters and is not defined in AddPersonalBankAccountParams.ts.

    2. Backend Validation & Precedent in PR #90350:

    The backend AddPersonalBankAccount command (like UpdatePersonalBankAccountInfo addressed in PR #90350) validates street input and rejects or discards street data containing newline characters (\n). As documented in PR #90350:

    "The BE concatenates addressStreet2 into addressStreet with a newline, so mirror that here to match the stored value."

    Because the frontend sent newlines in addressStreet instead of sending addressStreet and addressStreet2 as separate parameters, the backend rejected/dropped the street data.

    3. Why the "Review" Badge Appears:

    When the bank account is created without a valid street address, isPersonalBankAccountMissingInfo evaluates whether the bank account contains required owner details:

    function hasOwnerAddress(additionalData: AdditionalData): boolean {
        return !!additionalData?.addressStreet && !!additionalData?.addressCity && !!additionalData?.addressState && !!additionalData?.addressZipCode;
    }
    
    function isPersonalBankAccountMissingInfo(accountData: AccountData | undefined): boolean {
        ...
        return !hasOwnerName(additionalData) || !hasOwnerAddress(additionalData) || !hasOwnerPhone(additionalData);
    }

    Since additionalData.addressStreet is missing/empty, hasOwnerAddress(additionalData) returns false, causing isPersonalBankAccountMissingInfo to return true, which flags the account with the Review badge.

    4. Verification of Call Sites:

    Both caller components:

    1. src/pages/AddPersonalBankAccountPage/index.tsx (lines 132-133)
    2. src/pages/EnablePayments/Wallet/AddBankAccount/AddBankAccount.tsx (lines 92-93)

    already pass addressStreet and addressStreet2 as separate keys in the accountData object passed to addPersonalBankAccount. The omission and newline concatenation only occurred inside addPersonalBankAccount itself.


    What changes do you think we should make in order to solve the problem?

    1. Add addressStreet2 to AddPersonalBankAccountParams.ts:

    In src/libs/API/parameters/AddPersonalBankAccountParams.ts:

    --- a/src/libs/API/parameters/AddPersonalBankAccountParams.ts
    +++ b/src/libs/API/parameters/AddPersonalBankAccountParams.ts
    @@ -12,6 +12,7 @@ type AddPersonalBankAccountParams = {
         legalFirstName?: string;
         legalLastName?: string;
         addressStreet?: string;
    +    addressStreet2?: string;
         addressCity?: string;
         addressState?: string;
         addressZip?: string;

    2. Send addressStreet and addressStreet2 as separate parameters in BankAccounts.ts:

    In src/libs/actions/BankAccounts.ts:

    --- a/src/libs/actions/BankAccounts.ts
    +++ b/src/libs/actions/BankAccounts.ts
    @@ -561,7 +561,8 @@ function addPersonalBankAccount(
             phoneNumber: account?.phoneNumber,
             legalFirstName: account?.legalFirstName,
             legalLastName: account?.legalLastName,
    -        addressStreet: getFormattedStreet(account?.addressStreet, account?.addressStreet2),
    +        addressStreet: account?.addressStreet,
    +        addressStreet2: account?.addressStreet2 ?? '',
             addressCity: account?.addressCity,
             addressState: account?.addressState,
             addressZip: account?.addressZipCode,

    3. Display Consistency in ConfirmationStep.tsx:

    In src/pages/AddPersonalBankAccountPage/substeps/ConfirmationStep.tsx:44, ensure Address Line 2 is displayed in the address review item if present:

    --- a/src/pages/AddPersonalBankAccountPage/substeps/ConfirmationStep.tsx
    +++ b/src/pages/AddPersonalBankAccountPage/substeps/ConfirmationStep.tsx
    @@ -41,7 +41,9 @@ function ConfirmationStep({onNext, onMove, isEditing}: SubPageProps) {
                 phoneNumber: (phone && formatE164PhoneNumber(phone, countryCode)) ?? '',
                 legalFirstName: bankAccountPersonalDetails?.legalFirstName ?? privatePersonalDetails?.legalFirstName ?? '',
                 legalLastName: bankAccountPersonalDetails?.legalLastName ?? privatePersonalDetails?.legalLastName ?? '',
    -            addressStreet: bankAccountPersonalDetails?.addressStreet ?? currentAddress?.street ?? '',
    +            addressStreet: bankAccountPersonalDetails?.addressStreet2
    +                ? `${bankAccountPersonalDetails.addressStreet}, ${bankAccountPersonalDetails.addressStreet2}`
    +                : (bankAccountPersonalDetails?.addressStreet ?? currentAddress?.street ?? ''),
                 addressCity: bankAccountPersonalDetails?.addressCity ?? currentAddress?.city ?? '',
                 addressState: bankAccountPersonalDetails?.addressState ?? currentAddress?.state ?? '',
                 addressZip: bankAccountPersonalDetails?.addressZipCode ?? currentAddress?.zip ?? '',

    4. Automated Unit Tests:

    In tests/unit/BankAccountsTest.ts, add a unit test in describe('addPersonalBankAccount', ...):

    test('sends addressStreet and addressStreet2 as separate parameters without newlines', () => {
        addPersonalBankAccount(
            {
                addressStreet: '123 Main St',
                addressStreet2: 'Apt 4B',
                addressCity: 'New York',
                addressState: 'NY',
                addressZipCode: '10001',
            },
            undefined,
        );
    
        expect(mockWrite).toHaveBeenCalledWith(
            WRITE_COMMANDS.ADD_PERSONAL_BANK_ACCOUNT,
            expect.objectContaining({
                addressStreet: '123 Main St',
                addressStreet2: 'Apt 4B',
            }),
            expect.anything(),
        );
    });

    What alternative solutions did you explore? (Optional)

    • Concatenating addressStreet and addressStreet2 on the client with a comma or space (e.g. 123 Main St, Apt 4B). This was rejected because Expensify backend APIs and database schemas maintain distinct fields for address line 1 and line 2 (as established in UpdatePersonalBankAccountInfo in PR [No QA] Send addressStreet2 as separate param in UpdatePersonalBankAccountInfo #90350). Passing addressStreet2 as a distinct parameter follows the standard established throughout the codebase.
  9. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  10. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    📣 @David-2002065! 📣
    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:

    1. Make sure you've read and understood the contributing guidelines.
    2. 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.
    3. 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.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  11. David-2002065 commented on Oct 16, 2026

    @David-2002065
    Contributor

    Contributor details
    Your Expensify account email: [email protected]
    Upwork Profile Link: https://www.upwork.com/freelancers/~0162be2e4fafdbae90

  12. melvin-bot commented on Oct 16, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  13. 7 remaining items

  14. bonnhatnguyen commented on Oct 19, 2026

    @bonnhatnguyen

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When adding a US personal bank account (manually or via Plaid) and entering an address with Address Line 2 (addressStreet2), the address is not properly saved, causing the newly created bank account row to display a "Review" badge in Settings > Wallet.


    What is the root cause of that problem?

    1. Newline concatenation in addPersonalBankAccount (src/libs/actions/BankAccounts.ts):
      In src/libs/actions/BankAccounts.ts (line 564):

      addressStreet: getFormattedStreet(account?.addressStreet, account?.addressStreet2),

      getFormattedStreet(street1, street2) formats the street by joining both lines with a newline character:

      return `${street1}\n${street2}`;

      It assigns the combined string to addressStreet, while omitting addressStreet2 from the API parameters. In addition, addressStreet2 is completely missing from AddPersonalBankAccountParams.ts.

    2. Backend Rejection & Precedent in PR [No QA] Send addressStreet2 as separate param in UpdatePersonalBankAccountInfo #90350:
      The backend API AddPersonalBankAccount validates street parameters and rejects street fields containing raw newline characters (\n). As documented in PR #90350 ("[No QA] Send addressStreet2 as separate param in UpdatePersonalBankAccountInfo"):

      "The BE concatenates addressStreet2 into addressStreet with a newline, so mirror that here to match the stored value."

      Because addPersonalBankAccount sent newlines in addressStreet instead of sending addressStreet2 as an independent parameter, the backend dropped or failed validation for the address.

    3. Why the "Review" Badge appears:
      In src/libs/BankAccountUtils.ts (lines 175–193), isPersonalBankAccountMissingInfo validates whether an account has required owner address information via hasOwnerAddress:

      function hasOwnerAddress(additionalData: AdditionalData): boolean {
          return !!additionalData?.addressStreet && !!additionalData?.addressCity && !!additionalData?.addressState && !!additionalData?.addressZipCode;
      }

      Because additionalData.addressStreet was dropped, hasOwnerAddress returns false, causing isPersonalBankAccountMissingInfo to return true, which flags the bank account with the Review badge.

    4. Caller verification:
      Both calling components:

      • src/pages/AddPersonalBankAccountPage/index.tsx
      • src/pages/EnablePayments/Wallet/AddBankAccount/AddBankAccount.tsx
        already collect and store addressStreet and addressStreet2 as distinct fields in draft state. The incorrect formatting only happens inside addPersonalBankAccount when assembling API parameters.

    What changes do you think we should make in order to solve the problem?

    1. Add addressStreet2 to API parameter types (src/libs/API/parameters/AddPersonalBankAccountParams.ts):
    --- a/src/libs/API/parameters/AddPersonalBankAccountParams.ts
    +++ b/src/libs/API/parameters/AddPersonalBankAccountParams.ts
    @@ -12,6 +12,7 @@ type AddPersonalBankAccountParams = {
         legalFirstName?: string;
         legalLastName?: string;
         addressStreet?: string;
    +    addressStreet2?: string;
         addressCity?: string;
         addressState?: string;
         addressZip?: string;
    1. Send addressStreet and addressStreet2 separately in addPersonalBankAccount (src/libs/actions/BankAccounts.ts):
    --- a/src/libs/actions/BankAccounts.ts
    +++ b/src/libs/actions/BankAccounts.ts
    @@ -561,7 +561,8 @@ function addPersonalBankAccount(
             phoneNumber: account?.phoneNumber,
             legalFirstName: account?.legalFirstName,
             legalLastName: account?.legalLastName,
    -        addressStreet: getFormattedStreet(account?.addressStreet, account?.addressStreet2),
    +        addressStreet: account?.addressStreet,
    +        addressStreet2: account?.addressStreet2,
             addressCity: account?.addressCity,
             addressState: account?.addressState,
             addressZipCode: account?.addressZipCode,
    1. Unit Tests:
      Add a test case in tests/unit/BankAccountsTest.ts to assert that when addPersonalBankAccount is called with addressStreet and addressStreet2, the API call receives both parameters separately without newline concatenation.

    What alternative solutions did you explore? (Optional)

    • Replacing newlines with commas or spaces in addressStreet: Rejected because the backend expects addressStreet2 as a separate parameter for address normalization, matching UpdatePersonalBankAccountInfo.

    Contributor details
    Your Expensify account email: [email protected]
    Upwork Profile Link: https://www.upwork.com/freelancers/~0139ed4098bdc50182

  15. melvin-bot commented on Oct 19, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  16. puneetlath commented on Oct 21, 2026

    @puneetlath
    Contributor

    Will raise the backend PR

  17. puneetlath commented on Oct 21, 2026

    @puneetlath
    Contributor

    Ok PR to accept addressStreet2 in the API is up. @nyomanjyotisa can you go ahead and select a FE solution?

  18. nyomanjyotisa commented on Oct 22, 2026

    @nyomanjyotisa
    Member

    @puneetlath @MelvinBot’s revised frontend proposal looks good. We’ll need to verify both address lines persist after reload once the backend change is deployed, before merging.

    🎀👀🎀 C+ reviewed

  19. melvin-bot commented on Oct 22, 2026

    @melvin-bot

    Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

  20. puneetlath commented on Oct 22, 2026

    @puneetlath
    Contributor

    Ok sounds good. Please go ahead. The back-end change is already on staging.

  21. nyomanjyotisa commented on Oct 23, 2026

    @nyomanjyotisa
    Member

    @MelvinBot please implement the frontend changes in this proposal.

  22. MelvinBot commented on Oct 23, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: Send addressStreet2 as a separate param in AddPersonalBankAccount
    Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.

    addPersonalBankAccount now sends addressStreet (Line 1) and addressStreet2 (Line 2, or '') as separate params, matching updatePersonalBankAccountInfo. I added addressStreet2 to AddPersonalBankAccountParams and two unit tests.

    Unit tests, typecheck, lint, format, and spell checks pass. My automated web check couldn't run because the test browser session showed a blank page. Before merging, please check on staging that both address lines persist after reload.

  23. melvin-bot commented on Oct 24, 2026

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions