Skip to content

[Due for payment 2026-07-13] Infinite loading on Choose BA page when re-enable network during re-adding BA flow #92726

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.3.99-3
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: #91491
Email or phone of affected tester (no customers): kiatest.78+ck6426@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11/Chrome, iPhone 16/18.7.1
App Component: Workspace Settings

Action Performed:

Precondition:

  1. Logged in as new user >> Create new WS & go through adding Plaid BA in Workflows >> Payments step

  2. Disconnect the added BA

  3. Launch Hybrid app or Navigate to staging.new.expensify.com

  4. Go to Workflows >> Payments step >> Add bank account >> Log into your bank >> Finish the Plaid flow

  5. Select the same BA as selected in precondition (in this case Plaid saving)

  6. Verify the error "Bank account can't be created, it looks like a bank account with the same information already exists in your account." appears above the Next button.

  7. Go offline (either toggle airplane mode or force offline in debug menu

  8. Go online

  9. Observe user automatically redirected to Personal info page

  10. Tap back button on personal info page

Expected Result:

Choose BA options displayed in bank info page when user navigate back from personal info page after re-enabling network during re-adding BA flow

Actual Result:

Infinite loading on Choose BA page without displaying the bank account options when re-enable network during re-adding BA flow

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7171808_1780594756815.ScreenRecording_06-04-2026_12-31-34_1.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7171808

Activity

  1. applause-bot commented on Jun 4, 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/0370de4076d63d93132a80457b3dadf6d5763e3b9b267edad350b8b3cedeee1e

  2. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 4, 2026
  3. melvin-bot commented on Jun 4, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #91491

  4. melvin-bot commented on Jun 4, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Jun 4, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. MelvinBot commented on Jun 4, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    TL;DR — this deploy blocker is very likely not caused by Expensify/App#91491 (the auto-assigned PR). Reverting that PR would only re-introduce the duplicate-error bug it fixed; it would not fix this infinite loading. Confidence: high on that point, medium on the precise root cause below.

    Why #91491 is not the culprit: that PR's only behavioral change is gating when hideBankAccountErrors() runs. hideBankAccountErrors() only does Onyx.merge(REIMBURSEMENT_ACCOUNT, {error: '', errors: null}) — it never touches isLoading, plaidData, or navigation (ReimbursementAccount/index.ts:22-24). The infinite spinner is driven entirely by isLoading flags, so changing error-clearing timing can't cause it.

    Root cause (hypothesis): The "Choose an account" spinner is the in-component one in AddPlaidBankAccount.tsx:232-242, which renders when plaidData.bankAccounts is empty and plaidData.isLoading is true. On returning to the Plaid step after the offline→online refetch, plaidData.bankAccounts is empty, so the mount effect re-calls openPlaidBankLogin (AddPlaidBankAccount.tsx:138-150). That action optimistically SETs plaidData = {...DEFAULT_DATA, isLoading: true} (wiping accounts) but has no successData to flip isLoading back to false — unlike its sibling openPlaidBankAccountSelector (Plaid.ts:15-57 vs :101-141). If the OpenPlaidBankLogin response doesn't yield a link token that re-renders PlaidLink, isLoading stays true forever → infinite spinner with no accounts.

    Recommended fix: Add a successData block to openPlaidBankLogin that merges plaidData.isLoading: false (mirroring openPlaidBankAccountSelector). Before implementing, an internal engineer should confirm via repro/logs (a) that plaidData.bankAccounts is empty on return to the Plaid step (likely wiped by the OPEN_REIMBURSEMENT_ACCOUNT_PAGE re-fetch response) and (b) that OpenPlaidBankLogin returns without a usable link token in this path.

    Investigation details

    Repro recap: duplicate-account error shown on the Plaid "Choose an account" step → go offline → online → auto-redirected to Personal info (REQUESTOR) → tap Back → infinite spinner on Choose BA page, no accounts.

    The two possible spinners:

    • Page-level ReimbursementAccountLoadingIndicator — driven by reimbursementAccount.isLoading. openReimbursementAccountPage resets this via successData, so this is not the stuck one.
    • In-component ActivityIndicator — driven by plaidData.isLoading + empty bankAccounts. This matches the symptom "Choose BA page without the bank account options".

    Flow:

    1. Offline→online triggers fetchData(true) → openReimbursementAccountPage (ReimbursementAccountPage.tsx:298-300); backend advances currentStep to REQUESTOR. The auto-redirect to Personal info is the existing USDBankAccountStep/achData.currentStep sync (:264-282) — pre-existing, unrelated to Surface duplicate Plaid bank account error on USD VBBA flow #91491.
    2. Back from REQUESTOR → goToWithdrawalAccountSetupStep(BANK_ACCOUNT) (:409-414); AddPlaidBankAccount remounts.
    3. isAuthenticatedWithPlaid() is false (empty bankAccounts, no OAuth token, and the duplicate error lives on reimbursementAccount.errors, not plaidData.errors) → mount effect calls openPlaidBankLogin → isLoading stuck true (no successData).
    4. CONST.PLAID.DEFAULT_DATA.bankAccounts = [] (CONST/index.ts:3533-3539) confirms the optimistic SET wipes the list.

    Alternatives considered: (1) Page-level reimbursementAccount.isLoading stuck — ruled out, openReimbursementAccountPage has successData. (2) A different PR in the same release regressed the Plaid VBBA offline flow — worth a glance is the commit "avoid resetting Plaid data to prevent getting stuck when returning to the start of the VBBA flow", which targets the same symptom family. (3) The OPEN_REIMBURSEMENT_ACCOUNT_PAGE response itself resetting plaidData server-side (needs log confirmation).

    Open question needing logs/repro: exactly what empties plaidData.bankAccounts on the return trip. The missing successData explains why the resulting spinner is infinite rather than transient regardless.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/92726) to create a draft PR (adds successData to openPlaidBankLogin).
    To refine: @MelvinBot <your feedback> — e.g. if logs show plaidData is cleared elsewhere.
    To reject: Explain why this analysis is off-base.

  7. youssef-lr commented on Jun 4, 2026

    @youssef-lr
    Contributor
  8. IuliiaHerets commented on Jun 5, 2026

    @IuliiaHerets

    Issue is still reproducible on Windows 11 / Chrome in v9.3.99-7.
    Note:

    On step 6, the "An unexpected error..." appears instead of "Bank account can't be created, it looks like a bank account with the same information already exists in your account."

    bandicam.2026-06-05.14-54-39-519.mp4
  9. IuliiaHerets commented on Jun 5, 2026

    @IuliiaHerets

    In Prod, User is not automatically redirected to Personal info page, but the green button have infinite loading.
    Then if tap back, there is not infinite loading on the RHP.

    Prod_Staging_retest.mp4

    Stg - issue is still reproducible on iPhone 7 Plus / iOS 15.8.3 in v9.3.99-8

    Repro_Infinite.loading.mp4
  10. lakchote commented on Jun 5, 2026

    @lakchote
    Contributor

    @MelvinBot what is the offending PR for this issue?

  11. 41 remaining items

  12. melvin-bot commented on Jul 13, 2026

    @melvin-bot

    @youssef-lr Eep! 4 days overdue now. Issues have feelings too...

  13. melvin-bot commented on Jul 15, 2026

    @melvin-bot

    @youssef-lr 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  14. dmkt9 commented on Jul 16, 2026

    @dmkt9
    Contributor

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.27-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-07-13. 🎊

    @youssef-lr We haven't processed the payment for that PR yet. cc @mallenexpensify

  15. mallenexpensify commented on Jul 16, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dmkt9 paid $250 via Upwork

    ^ Test case created. Thx

  16. dmkt9 commented on Jul 22, 2026

    @dmkt9
    Contributor

    Contributor+: @dmkt9 due $250 via NewDot

    @mallenexpensify I am still receiving payments through Upwork. Thanks.

  17. mallenexpensify commented on Jul 22, 2026

    @mallenexpensify
    Contributor

    @dmkt9 can you please accept the job below? Please reply here and tag me once you have.

    https://www.upwork.com/jobs/~022079986280366749180

  18. dmkt9 commented on Jul 23, 2026

    @dmkt9
    Contributor

    @dmkt9 can you please accept the job below? Please reply here and tag me once you have.

    @mallenexpensify Thanks. I've accepted the offer

  19. mallenexpensify commented on Jul 23, 2026

    @mallenexpensify
    Contributor

    @dmkt9 paid, summary updated above. Thx.

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions