Skip to content

[Due for payment 2026-11-05] [$175] Bank account - Address line is not saved when adding an US bank account #104165

Closed

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: @mallenexpensify
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: janithad2@gmail.com
    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: dilshodmackbook@gmail.com
    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. 30 remaining items

  14. added
    ReviewingHas a PR in review
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 29, 2026
  15. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  17. mallenexpensify commented on Nov 6, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @nyomanjyotisa due $175 via NewDot

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething 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