Skip to content

[$250] Add BA - Business Information step is skipped when connecting non-US BA #80385

Closed

Description

@lanitochka17

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: 9.3.7-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: https://test-management.browserstack.com/projects/2219752/folder/13176691/test-cases/41236748
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: MacBook Air 15.7.3 Chrome
App Component: Other

Action Performed:

  1. Sign in to ND
  2. Create a workspace, selecting AUD as a primary currency
  3. Proceed through steps 1-2, entering random info, that does not trigger an error
  4. On the confirmation screen at the end of step 2 click "Confirm"

Expected Result:

User is navigated to step 3 "What's the business name" page

Actual Result:

Step 3 "Business information" is skipped, user is navigated to the step 4 (sometimes even step 5)

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7056597_1769190701949.Steps_skipped_AUD_BA.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022014772193439070623
  • Upwork Job ID: 2014772193439070623
  • Last Price Increase: 2026-01-30
Issue OwnerCurrent Issue Owner: @brianlee-expensify

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 23, 2026
  2. changed the title [-]Add BA - Business Information step is skipped when connecting non-US BA[/-] [+][$250] Add BA - Business Information step is skipped when connecting non-US BA[/+] on Jan 23, 2026
  3. melvin-bot commented on Jan 23, 2026

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 23, 2026
  5. melvin-bot commented on Jan 23, 2026

    @melvin-bot

    Triggered auto assignment to @brianlee-expensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  6. melvin-bot commented on Jan 23, 2026

    @melvin-bot

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

  7. daledah commented on Jan 23, 2026

    @daledah
    Contributor

    Proposal

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

    When creating a workspace with AUD currency (non-USD), after completing step 2 (Bank Info) and clicking "Confirm", step 3 (Business Information) is skipped and the user is navigated directly to step 4 or 5.

    What is the root cause of that problem?

    The issue is caused by a race condition with asynchronous Onyx state updates across multiple steps.

    In BankInfo.tsx (step 2), when the API succeeds:

    useEffect(() => {
    if (reimbursementAccount?.isLoading === true || !!reimbursementAccount?.errors) {
    return;
    }
    if (reimbursementAccount?.isSuccess === true) {
    onSubmit();
    clearReimbursementAccountBankCreation();
    }
    }, [corpayFields?.bankCurrency, country, currency, onSubmit, reimbursementAccount?.errors, reimbursementAccount?.isLoading, reimbursementAccount?.isSuccess]);

    The clearReimbursementAccountBankCreation() function uses Onyx.merge() which is asynchronous:

    function clearReimbursementAccountBankCreation() {
    Onyx.merge(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {isCreateCorpayBankAccount: null, isSuccess: null, isLoading: null});
    }

    When BusinessInfo.tsx (step 3) mounts, it also has a similar useEffect:

    useEffect(() => {
    // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
    if (reimbursementAccount?.errors || reimbursementAccount?.isSavingCorpayOnboardingCompanyFields || !reimbursementAccount?.isSuccess) {
    return;
    }
    if (reimbursementAccount?.isSuccess) {
    onSubmit();
    clearReimbursementAccountSaveCorpayOnboardingCompanyDetails();
    }
    return () => {
    clearReimbursementAccountSaveCorpayOnboardingCompanyDetails();
    };
    }, [reimbursementAccount?.errors, reimbursementAccount?.isSavingCorpayOnboardingCompanyFields, reimbursementAccount?.isSuccess, onSubmit]);

    The race condition:

    1. BankInfo (step 2) succeeds, isSuccess becomes true
    2. BankInfo calls onSubmit() to move to BusinessInfo (step 3)
    3. BankInfo calls clearReimbursementAccountBankCreation() to reset isSuccess to null (async)
    4. BusinessInfo mounts before the Onyx merge completes
    5. BusinessInfo sees isSuccess === true (from step 2's success)
    6. BusinessInfo immediately calls onSubmit(), skipping to step 4

    The same cascade can occur for subsequent steps, causing step 4 and 5 to also be skipped.

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

    Add a step-specific flag check to ensure we only proceed when this step's API was called, not a previous step's. Each step already has a unique loading flag (e.g., isSavingCorpayOnboardingCompanyFields for BusinessInfo). We should track when this flag transitions from true to false with isSuccess === true.

    In BusinessInfo.tsx:

    +const prevIsSaving = usePrevious(reimbursementAccount?.isSavingCorpayOnboardingCompanyFields);
    
     useEffect(() => {
    -    if (reimbursementAccount?.errors || reimbursementAccount?.isSavingCorpayOnboardingCompanyFields || !reimbursementAccount?.isSuccess) {
    +    // Only proceed if THIS step's API call completed successfully (not a previous step's)
    +    if (
    +        reimbursementAccount?.errors ||
    +        reimbursementAccount?.isSavingCorpayOnboardingCompanyFields ||
    +        !reimbursementAccount?.isSuccess ||
    +        !prevIsSaving  // Ensure we were actually saving from this step
    +    ) {
             return;
         }
    
         if (reimbursementAccount?.isSuccess) {
             onSubmit();
             clearReimbursementAccountSaveCorpayOnboardingCompanyDetails();
         }
    -}, [reimbursementAccount?.errors, reimbursementAccount?.isSavingCorpayOnboardingCompanyFields, reimbursementAccount?.isSuccess, onSubmit]);
    +}, [reimbursementAccount?.errors, reimbursementAccount?.isSavingCorpayOnboardingCompanyFields, reimbursementAccount?.isSuccess, onSubmit, prevIsSaving]);

    What alternative solutions did you explore? (Optional)

    Or we can add the Navigation.setNavigationActionToMicrotaskQueue to wrap onSubmit();

            if (reimbursementAccount?.isSuccess) {
                clearReimbursementAccountBankCreation();
                Navigation.setNavigationActionToMicrotaskQueue(()=>{
                    onSubmit();
                })
            }
    
  8. DylanDylann commented on Jan 26, 2026

    @DylanDylann
    Contributor

    I can't reproduce

    Screen.Recording.2026-01-26.at.14.15.51.mov

    @daledah can you reproduce this bug on now?

  9. daledah commented on Jan 26, 2026

    @daledah
    Contributor

    @DylanDylann i can reproduce it with a new AUD workspace

    bug.mov
  10. DylanDylann commented on Jan 26, 2026

    @DylanDylann
    Contributor

    Thanks @daledah, I can reproduce it now after installing the new node module

  11. 19 remaining items

  12. daledah commented on Feb 25, 2026

    @daledah
    Contributor

    @neil-marcellini kindly reminder here

  13. neil-marcellini commented on Feb 27, 2026

    @neil-marcellini
    Contributor

    cool thanks, closing.

  14. daledah commented on Mar 1, 2026

    @daledah
    Contributor

    @neil-marcellini @brianlee-expensify please handle the payment here since i was assigned to this issue and created the open PR here

  15. brianlee-expensify commented on Mar 2, 2026

    @brianlee-expensify
    Contributor

    @neil-marcellini based on this SO (https://stackoverflowteams.com/c/expensify/questions/7582/7583#7583:~:text=100%25%20if%20the,reviewed%20the%20PR.) it seems like we would still pay the full $250 - just wanted to confirm if the following still need to be done?

    1. @DylanDylann should identify the PR that fixed this issue
    2. @DylanDylann to fill out the BZ checklist and regression test steps

    CC @mallenexpensify (see slack thread here to help with final decision)

  16. brianlee-expensify commented on Mar 2, 2026

    @brianlee-expensify
    Contributor

    confirmed with Matt Allen that no need to fill out the BZ checklist and regression test steps

    @MelvinBot can you identify the PR that solved the bug here?

  17. MelvinBot commented on Mar 2, 2026

    @MelvinBot
    Contributor

    The PR that fixed this bug is PR #80354 - feat: Refactor FullStep components by MrMuzyk, merged on Feb 3, 2026.

    Evidence:

    • The PR description explicitly states: "Fixed an issue where for non USD BAs steps 3 and 4 were being skipped"
    • It modified both BankInfo.tsx and BusinessInfo.tsx — the exact files involved in this bug's race condition
    • The QA steps include: "Steps 3 and 4 should not be skipped"
    • Timeline matches: the PR merged on Feb 3, and by Feb 9-11 both DylanDylann and daledah confirmed the bug was no longer reproducible on main

    The PR was linked to issue Expensify/App#79047 (a refactoring task), but the refactoring also resolved the step-skipping race condition described in this issue.

  18. brianlee-expensify commented on Mar 2, 2026

    @brianlee-expensify
    Contributor

    Payment Summary

  19. garrettmknight commented on Mar 6, 2026

    @garrettmknight
    Contributor

    $250 approved for @daledah

  20. JmillsExpensify commented on Mar 10, 2026

    @JmillsExpensify
    Contributor

    $250 approved for @DylanDylann

  21. mcdonaldsmenus commented on Jun 17, 2026

    @mcdonaldsmenus

    We provide useful information about popular choices, latest updates, and the McDonalds What’s New Menu to help you explore fresh flavors and exciting options. Whether you are looking for classic favorites or new menu items, our content makes it easier to find the best McDonald’s meals for every taste.

  22. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    📣 @mcdonaldsmenus! 📣
    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>
    
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