Skip to content

[HOLD for payment 2024-11-14] [HOLD for payment 2024-11-13] [$250] Bank account - App crashes when connecting to bank account #51961

Closed

Description

@IuliiaHerets

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.0.57-0
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+kh22100010ad@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Workspace settings > Workflows.
  3. Click Connect bank account.
  4. Click Update to USD.

Expected Result:

App will not crash when connecting to bank account.

Actual Result:

App crashes when connecting to bank account.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

0411_2.txt

Bug6654429_1730734277937.20241104_230327.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021853501012094691283
  • Upwork Job ID: 1853501012094691283
  • Last Price Increase: 2024-11-04
  • Automatic offers:
    • DylanDylann | Reviewer | 104737674
    • CyberAndrii | Contributor | 104737676
Issue OwnerCurrent Issue Owner: @muttmuure

Activity

  1. added
    DeployBlockerCash
    Bug
    on Nov 4, 2024
  2. melvin-bot commented on Nov 4, 2024

    @melvin-bot

    Triggered auto assignment to @muttmuure (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.

  3. melvin-bot commented on Nov 4, 2024

    @melvin-bot

    Triggered auto assignment to @blimpich (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Nov 4, 2024

    @melvin-bot

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

  5. github-actions commented on Nov 4, 2024

    @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. nkdengineer commented on Nov 4, 2024

    @nkdengineer
    Contributor

    Proposal

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

    App crashes when connecting to bank account.

    What is the root cause of that problem?

    we have this error Cannot access 'hasInProgressVBBA' before initialization

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

    We should move function hasInProgressVBBA to above place where we define the state shouldShowContinueSetupButton here

    function hasInProgressVBBA(): boolean {
    return !!achData?.bankAccountID && !!achData?.state && achData?.state !== BankAccount.STATE.OPEN && achData?.state !== BankAccount.STATE.LOCKED;
    }

    What alternative solutions did you explore? (Optional)

  7. andriivitiv commented on Nov 4, 2024

    @andriivitiv
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-11-04 16:51:33 UTC.

    Proposal

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

    Bank account - App crashes when connecting to bank account

    What is the root cause of that problem?

    Long time ago 98b1256 moved the call to getShouldShowContinueSetupButtonInitialValue() above the place where the function is defined.

    It was moved back in #51315 but it recently got reverted by #51857.

    The PR after which this crash started to occur is #51718. It changed

    !requestorStepRef.current

    to

    !requestorStepRef?.current

    I think this caused the compiler to generate a different lowered code. The following code seems to prevent the crash

    !requestorStepRef || !requestorStepRef.current

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

    Move this functions a few lines up before the call to getShouldShowContinueSetupButtonInitialValue()

    function getBankAccountFields(fieldNames: InputID[]): Partial<ACHDataReimbursementAccount> {
    return {
    ...lodashPick(reimbursementAccount?.achData, ...fieldNames),
    };
    }
    /**
    * Returns true if a VBBA exists in any state other than OPEN or LOCKED
    */
    function hasInProgressVBBA(): boolean {
    return !!achData?.bankAccountID && !!achData?.state && achData?.state !== BankAccount.STATE.OPEN && achData?.state !== BankAccount.STATE.LOCKED;
    }
    /*
    * Calculates the state used to show the "Continue with setup" view. If a bank account setup is already in progress and
    * no specific further step was passed in the url we'll show the workspace bank account reset modal if the user wishes to start over
    */
    function getShouldShowContinueSetupButtonInitialValue(): boolean {
    if (!hasInProgressVBBA()) {
    // Since there is no VBBA in progress, we won't need to show the component ContinueBankAccountSetup
    return false;
    }
    return achData?.state === BankAccount.STATE.PENDING || [CONST.BANK_ACCOUNT.STEP.BANK_ACCOUNT, ''].includes(getStepToOpenFromRouteParams(route));
    }

    Also avoid calling it again on every render

    -    const [shouldShowContinueSetupButton, setShouldShowContinueSetupButton] = useState(getShouldShowContinueSetupButtonInitialValue());
    +    const [shouldShowContinueSetupButton, setShouldShowContinueSetupButton] = useState(getShouldShowContinueSetupButtonInitialValue);
    
  8. DylanDylann commented on Nov 4, 2024

    @DylanDylann
    Contributor

    I also see this bug today. But I don't understand why this bug happens after reverting #51315. TBH, #51315 fix another bug and we already reverted by #51857. Anyone help to investigate why this bug doesn't happen before merging #51315

  9. 47 remaining items

  10. melvin-bot commented on Nov 18, 2024

    @melvin-bot

    @blimpich, @CyberAndrii, @muttmuure, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. DylanDylann commented on Nov 19, 2024

    @DylanDylann
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on both staging and production
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: https://expensify.slack.com/archives/C01GTK53T8Q/p1730736248203919

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Test:

    1. Go to Workspace settings > Workflows.
    2. Click Connect bank account.
    3. Click Update to USD to change the currency
    4. Verify the app does not crash.

    Do we agree 👍 or 👎

  12. melvin-bot commented on Nov 20, 2024

    @melvin-bot

    @blimpich, @CyberAndrii, @muttmuure, @DylanDylann Eep! 4 days overdue now. Issues have feelings too...

  13. muttmuure commented on Nov 20, 2024

    @muttmuure
    Contributor

    @CyberAndrii - $250 for C
    @DylanDylann - $250 for C+

  14. melvin-bot commented on Nov 26, 2024

    @melvin-bot

    @blimpich, @CyberAndrii, @muttmuure, @DylanDylann Huh... This is 4 days overdue. Who can take care of this?

  15. muttmuure commented on Nov 26, 2024

    @muttmuure
    Contributor

    This is paid up and regression test created

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions