Skip to content

[Due for payment 2026-11-05] [$175] Android - Unexpected error text appears instead of Review text when connect BA #104723

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.16-0
Reproducible in staging?: Yes
Reproducible in production?: Unable to validate in Prod - Provide reasoning.
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #104434
Email or phone of affected tester (no customers): fischer9966+102226+104434am@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Google Pixel 5 / Android 14
App Component: User Settings

Action Performed:

Precondition:

  1. As the admin in OldDot create new workspace
  2. Enable Workflows > "Collect bank account details" for this workspace
  3. Invite new member without personal bank account connected

Steps:

  1. Login to Android App as member from Precondition Step 3
  2. Check an "Add deposit account" task with "Fix" button is shown in the Time sensitive section of Home Tab
  3. Tap "Fix"
  4. Verify the Collect deposit account flow opens
  5. Complete the flow and add a bank account.
  6. Tap "Confirm" on "Check your info" page
  7. Verify that the warning is displayed with text "Please review your account number and routing number one more time before continuing..."

Expected Result:

The warning is displayed with text "Please review your account number and routing number one more time before continuing..." on "Check your info" page when user connect personal BA.

Actual Result:

Text "Unexpected error ..." is displayed instead of warning "Please review your account number and routing number one more time before continuing..." on "Check your info" page when user connect personal BA.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7292907_1792651828430.104434-Android-Unexpected-Error-instead-off-review.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7292907

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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 22, 2026
  2. MelvinBot commented on Oct 22, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When the bank check fails, two errors land in PERSONAL_BANK_ACCOUNT.errors, and the page shows only the one with the newest timestamp key:

    1. The backend sends the specific "Please review your account number…" error. The server clock sets its key.
    2. The request's failureData adds the generic "An unexpected error occurred while trying to add your bank account…" error. The device clock sets its key (BankAccounts.ts:95-101).

    Surface verification error in Collect Deposit Account flow changed the Confirm page to show only getLatestError(...) (Confirmation.tsx:97-101). If the device clock runs ahead of the server, the generic error gets the larger key and wins. That explains why one device shows it and others don't.

    The Home-tab entry point is not involved. Wallet and Home use the same component and API call.

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

    In createCollectOnlyDepositAccount, pass 0 as the error key for the generic failureData error. A server error then always sorts newer, and the generic text still shows when the server sends no error. The same file already does this, with a comment about clock skew (BankAccounts.ts:612-615).

    Add a unit test: given a server error and the generic fallback, getLatestError returns the server error.

    What alternative solutions did you explore? (Optional)

    On the Confirm page, hide the generic fallback whenever another error exists. This works, but it puts the fix in the UI and doesn't fix the data.

    Investigation details
    • The "Please review…" text is not in App, so it comes from the backend response's onyxData.
    • OnyxUpdates.ts:74-99 applies the response onyxData first, then merges failureData. Both errors stay in errors.
    • The default error key is Date.now() * 1000 on the device (ErrorUtils.ts:49-51). getLatestError picks the highest key (ErrorUtils.ts:173-180).
    • I did not confirm the test device's clock offset. The code path is clear, but treat clock skew on this device as unconfirmed.

    Possibly related: [$175] All - Empty "Check your info" page appears in RHP after adding BA to Wallet shows the same generic error after Confirm, but it comes from a stale screen left after success. It is a different cause.


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


    view run

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

    @melvin-bot

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

  5. Abdallah-1551 commented on Oct 22, 2026

    @Abdallah-1551

    Proposal

    Note: no analysis from Kimi was provided, and the discussion has no developer investigation. The root cause below is inferred from the symptoms and from how Expensify's API error handling normally works. Step 1 of the changes confirms it before the fix is applied.

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

    A member adds a personal deposit bank account through the "Add deposit account" flow, which opens from the Home "Time sensitive" Fix task when the workspace has "Collect bank account details" enabled. On the "Check your info" page they tap Confirm. The backend's first-attempt response should show the message "Please review your account number and routing number one more time before continuing…". Instead the page shows the generic "Unexpected error…" text, so the user never sees the guidance they need to double-check their details. It was reproduced on Android.

    What is the root cause of that problem?

    The server returns a specific, user-facing message with a non-200 jsonCode when the user first confirms the account details. The client then displays the generic error instead of that message.

    The most likely cause is in the personal bank account action (addPersonalBankAccount in src/libs/actions/BankAccounts.ts, used by the Check your info step). Its failureData unconditionally sets a hard-coded error, getMicroSecondOnyxErrorWithTranslationKey('walletPage.addBankAccountFailure'), on ONYXKEYS.PERSONAL_BANK_ACCOUNT. When the request comes back with a non-success jsonCode, this failureData is applied to Onyx and wins over the server's message. The confirmation step only renders personalBankAccount.errors, so it shows the generic text and the server's message is dropped.

    This is a client-side issue in the request handling. The server response is correct. The reproduction was only on Android, but the logic is not platform-specific, so other platforms are likely affected too.

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

    1. Confirm the cause. Log or inspect the AddPersonalBankAccount response on Android. It should contain jsonCode ≠ 200 and a message with the "Please review your account number…" text. Also check whether PERSONAL_BANK_ACCOUNT.errors is overwritten by failureData.

    2. Stop the hard-coded failure error from overriding the server message. In src/libs/actions/BankAccounts.ts, keep the generic error only as a fallback. Switch the call to API.makeRequestWithSideEffects, or add a response handler, so the server message can be used:

    function addPersonalBankAccount(account: PlaidBankAccount, policyID?: string, source?: string) {
        const parameters = {/* unchanged */};
    
        const onyxData: OnyxData = {
            optimisticData: [{
                onyxMethod: Onyx.METHOD.MERGE,
                key: ONYXKEYS.PERSONAL_BANK_ACCOUNT,
                value: {isLoading: true, errors: null},
            }],
            successData: [{
                onyxMethod: Onyx.METHOD.MERGE,
                key: ONYXKEYS.PERSONAL_BANK_ACCOUNT,
                value: {isLoading: false, errors: null, shouldShowSuccess: true},
            }],
            // No hard-coded error here – it is resolved from the response below
            failureData: [{
                onyxMethod: Onyx.METHOD.MERGE,
                key: ONYXKEYS.PERSONAL_BANK_ACCOUNT,
                value: {isLoading: false},
            }],
        };
    
        API.makeRequestWithSideEffects(WRITE_COMMANDS.ADD_PERSONAL_BANK_ACCOUNT, parameters, onyxData).then((response) => {
  6. changed the title [-]Android - Unexpected error text appears instead of Review text when connect BA[/-] [+][$175] Android - Unexpected error text appears instead of Review text when connect BA[/+] on Oct 22, 2026
  7. melvin-bot commented on Oct 22, 2026

    @melvin-bot
  8. melvin-bot commented on Oct 22, 2026

    @melvin-bot

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

  9. camesenin commented on Oct 22, 2026

    @camesenin
  10. melvin-bot commented on Oct 22, 2026

    @melvin-bot

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

  11. huult commented on Oct 23, 2026

    @huult
    Contributor

    // Key 0 so a server-sent error always sorts newer than this fallback, even with device clock skew
    errors: getMicroSecondOnyxErrorWithTranslationKey('walletPage.addBankAccountFailure', 0),

    We can add key 0 so that a server-sent error always sorts newer than this fallback, even when there's device clock skew, as in the current solution.

    value: {errors: getMicroSecondOnyxErrorWithTranslationKey('walletPage.addBankAccountFailure')},

    - value: {errors: getMicroSecondOnyxErrorWithTranslationKey('walletPage.addBankAccountFailure')}, 
    + value: {errors: getMicroSecondOnyxErrorWithTranslationKey('walletPage.addBankAccountFailure', 0)}, 

    I'm happy to proceed with @MelvinBot's proposal. LGTM!

    🎀 👀 🎀 c+ reviewed.

  12. 21 remaining items

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 30, 2026
  14. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  15. 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
  16. mallenexpensify commented on Nov 6, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @huult due $175 via NewDot

  17. JmillsExpensify commented on Nov 15, 2026

    @JmillsExpensify
    Contributor

    $175 approved for @huult

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions