App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-09-10] [$250] Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over

Open IuliiaHerets opened this issue 1 year ago β€’ 21 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.25-10 Reproducible in staging?: Y Reproducible in production?: unable to check Issue was found when executing this PR: https://github.com/Expensify/App/pull/47841 Issue reported by: Applause Internal Team

Action Performed:

  1. Open the app and log in with the account that has several workspaces
  2. Navigate to workspace settings > More features
  3. Enable workflows
  4. Open workflows > Connect bank account
  5. Select "Connect online with Plaid"
  6. Select Regions and continued adding VBA
  7. Quit the flow half way
  8. Navigate to Workflows > Connect bank account
  9. Select start over
  10. Navigate to the list of workspaces

Expected Result:

There should not be no RBRs

Actual Result:

The RBR is displayed on every workspace

Workaround:

Unknown

Platforms:

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [x] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

https://github.com/user-attachments/assets/601617db-86b2-40d1-aad6-1cc6be1ad5b6

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0180cfb0a524c49cdc
  • Upwork Job ID: 1828775893654614402
  • Last Price Increase: 2024-08-28
  • Automatic offers:
    • paultsimura | Reviewer | 103721395
    • NJ-2020 | Contributor | 103721396
Issue OwnerCurrent Issue Owner: @paultsimura

IuliiaHerets avatar Aug 28 '24 12:08 IuliiaHerets

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

melvin-bot[bot] avatar Aug 28 '24 12:08 melvin-bot[bot]

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

melvin-bot[bot] avatar Aug 28 '24 12:08 melvin-bot[bot]

:wave: 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.

github-actions[bot] avatar Aug 28 '24 12:08 github-actions[bot]

We think that this bug might be related to #wave-collect - Release 1

IuliiaHerets avatar Aug 28 '24 12:08 IuliiaHerets

Proposal

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

Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over

What is the root cause of that problem?

When we quit when adding the bank details in half way, then trying to reconnect and click start over, the reimbursement account (bank account) errors returning empty object So when we check here if there's any error, empty object will return true https://github.com/Expensify/App/blob/1bb113191ddf05810e795e04f7651ddc89a58d5a/src/pages/workspace/WorkspacesListPage.tsx#L309

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

We can replace the reimbursementAccount?.errors to !isEmptyObject(reimbursementAccount?.errors) to check if it's not an empty object and also the type of the reimbursementAccount?.errors is Record<string, string | null> So we will change from:

const reimbursementAccountBrickRoadIndicator = reimbursementAccount?.errors ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined;

To:

const reimbursementAccountBrickRoadIndicator = !isEmptyObject(reimbursementAccount?.errors) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined;

What alternative solutions did you explore? (Optional)

NJ-2020 avatar Aug 28 '24 12:08 NJ-2020

Job added to Upwork: https://www.upwork.com/jobs/~0180cfb0a524c49cdc

melvin-bot[bot] avatar Aug 28 '24 12:08 melvin-bot[bot]

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

melvin-bot[bot] avatar Aug 28 '24 12:08 melvin-bot[bot]

Reproduced, opening up. @dangrous I'm not 100% sure we need to block the deploy for this one since it's a pretty niche issue and ultimately a UI issue so far as I can tell. What do you think?

garrettmknight avatar Aug 28 '24 12:08 garrettmknight

Edited by proposal-police: This proposal was edited at 2024-08-28 13:05:27 UTC.

Proposal

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

Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over

What is the root cause of that problem?

When we call resetFreePlanBankAccount in success data we add DEFAULT_DATA in which we have errors: {}, So whenever we check for reimbursementAccount?.errors, it will evaluate to true because it's an empty object. https://github.com/Expensify/App/blob/1bb113191ddf05810e795e04f7651ddc89a58d5a/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.ts#L78-L81 https://github.com/Expensify/App/blob/1bb113191ddf05810e795e04f7651ddc89a58d5a/src/CONST.ts#L4468-L4478

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

In default data we can either remove errors and errorfields or we can set them to null https://github.com/Expensify/App/blob/1bb113191ddf05810e795e04f7651ddc89a58d5a/src/CONST.ts#L4468-L4478

            errorFields: null,
            errors: null,

Note: removing errorFields is optional. This error can also be resolved by only removing errors or setting it to null

What alternative solutions did you explore? (Optional)

In backend response the data is set to null in success data we can also remove this https://github.com/Expensify/App/blob/1bb113191ddf05810e795e04f7651ddc89a58d5a/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.ts#L78-L82

Screenshot 2024-08-28 at 5 57 40β€―PM

Nodebrute avatar Aug 28 '24 12:08 Nodebrute

Reviewing now πŸ‘€

paultsimura avatar Aug 28 '24 13:08 paultsimura

The proposal by @NJ-2020 looks good to me.

We use the same check here: https://github.com/Expensify/App/blob/a2645b505a0e8c05b6efc67d9d00b8edc5400c82/src/pages/workspace/WorkspaceInitialPage.tsx#L220

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

paultsimura avatar Aug 28 '24 13:08 paultsimura

Current assignee @dangrous is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] avatar Aug 28 '24 13:08 melvin-bot[bot]

Hwy @paultsimura, thanks for the review! I appreciate the feedback, but I think using isEmptyObject might be more of a workaround. When we're starting over, we don't need errors:{}. This approach is similar to how we handle other default data. https://github.com/Expensify/App/blob/dc5aaeb7e2715782cd157cde111a67a9614db2bd/src/CONST.ts#L1121-L1122

Nodebrute avatar Aug 28 '24 13:08 Nodebrute

@Nodebrute we use errors: {} as a default value in other places related to banking:

https://github.com/Expensify/App/blob/7dae918fa165f583e5818f1dc4fa690bf54b99c1/src/pages/EnablePayments/AdditionalDetailsStep.tsx#L33

https://github.com/Expensify/App/blob/8510c65be84612c6c848ec9d339071071bbc7503/src/pages/EnablePayments/OnfidoPrivacy.tsx#L26

IMO, we should stick to it and fix the RBR handling as in the selected proposal.

paultsimura avatar Aug 28 '24 14:08 paultsimura

@paultsimura Thank you for clarifying. I appreciate it!

Nodebrute avatar Aug 28 '24 14:08 Nodebrute

works for me! assigning @NJ-2020

dangrous avatar Aug 28 '24 16:08 dangrous

πŸ“£ @paultsimura πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Aug 28 '24 16:08 melvin-bot[bot]

πŸ“£ @NJ-2020 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Aug 28 '24 16:08 melvin-bot[bot]

PR Ready

cc: @paultsimura

NJ-2020 avatar Aug 29 '24 03:08 NJ-2020

Deployed to production: https://github.com/Expensify/App/pull/48231#issuecomment-2325378456 Payment is due on Sep 10

paultsimura avatar Sep 03 '24 06:09 paultsimura

  • The PR that introduced the bug has been identified. Link to the PR: https://github.com/Expensify/App/pull/33280
  • 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: https://github.com/Expensify/App/commit/84071e878eea68cbcfc224d9ce6a43359f77b53f#r146382434
  • A discussion in #expensify-bugs 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: N/A
  • Determine if we should create a regression test for this bug: Yes
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Proposal

  1. Open the app and log in with the account that has several workspaces
  2. Navigate to workspace settings > More features
  3. Enable workflows
  4. Open workflows > Connect bank account
  5. Select "Connect online with Plaid"
  6. Select "Regions bank" and continue adding VBA
  7. Quit the flow half-way
  8. Navigate to Workflows > Connect bank account
  9. Select "start over"
  10. Navigate to the list of workspaces
  11. Verify that there's no RBR in the workspaces list

Do we agree πŸ‘ or πŸ‘Ž

paultsimura avatar Sep 07 '24 19:09 paultsimura

Payment Summary:

  • Contributor: @NJ-2020 $250 paid via Upwork
  • Reviewer: @paultsimura $250 paid via Upwork

garrettmknight avatar Sep 11 '24 09:09 garrettmknight