Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 6 tasks
IuliiaHerets opened this issue Aug 28, 2024 · 22 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 28, 2024

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: #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
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6584835_1724812499936.Recording__725.mp4

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: @garrettmknight
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Aug 28, 2024
Copy link

melvin-bot bot commented Aug 28, 2024

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

Copy link

melvin-bot bot commented Aug 28, 2024

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 melvin-bot bot added the Daily KSv2 label Aug 28, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Aug 28, 2024
Copy link
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.

@IuliiaHerets
Copy link
Author

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

@NJ-2020
Copy link
Contributor

NJ-2020 commented Aug 28, 2024

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

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

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)

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Aug 28, 2024
@melvin-bot melvin-bot bot changed the title Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over [$250] Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over Aug 28, 2024
Copy link

melvin-bot bot commented Aug 28, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 28, 2024
Copy link

melvin-bot bot commented Aug 28, 2024

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

@garrettmknight
Copy link
Contributor

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?

@Nodebrute
Copy link
Contributor

Nodebrute commented Aug 28, 2024

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.

{
onyxMethod: Onyx.METHOD.SET,
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: CONST.REIMBURSEMENT_ACCOUNT.DEFAULT_DATA,

App/src/CONST.ts

Lines 4468 to 4478 in 1bb1131

REIMBURSEMENT_ACCOUNT: {
DEFAULT_DATA: {
achData: {
state: BankAccount.STATE.SETUP,
},
isLoading: false,
errorFields: {},
errors: {},
maxAttemptsReached: false,
shouldShowResetModal: false,
},

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

App/src/CONST.ts

Lines 4468 to 4478 in 1bb1131

REIMBURSEMENT_ACCOUNT: {
DEFAULT_DATA: {
achData: {
state: BankAccount.STATE.SETUP,
},
isLoading: false,
errorFields: {},
errors: {},
maxAttemptsReached: false,
shouldShowResetModal: false,
},

            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

{
onyxMethod: Onyx.METHOD.SET,
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: CONST.REIMBURSEMENT_ACCOUNT.DEFAULT_DATA,
},

Screenshot 2024-08-28 at 5 57 40 PM

@paultsimura
Copy link
Contributor

Reviewing now 👀

@garrettmknight garrettmknight added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API Hourly KSv2 labels Aug 28, 2024
@paultsimura
Copy link
Contributor

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

We use the same check here:

brickRoadIndicator: !isEmptyObject(reimbursementAccount?.errors) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 28, 2024

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

@Nodebrute
Copy link
Contributor

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.

App/src/CONST.ts

Lines 1121 to 1122 in dc5aaeb

DEFAULT_ACCOUNT_DATA: {errors: null, success: '', isLoading: false},
DEFAULT_CLOSE_ACCOUNT_DATA: {errors: null, success: '', isLoading: false},

@paultsimura
Copy link
Contributor

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

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

@Nodebrute
Copy link
Contributor

@paultsimura Thank you for clarifying. I appreciate it!

@dangrous
Copy link
Contributor

works for me! assigning @NJ-2020

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 28, 2024
Copy link

melvin-bot bot commented Aug 28, 2024

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

Copy link

melvin-bot bot commented Aug 28, 2024

📣 @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 📖

@NJ-2020 NJ-2020 mentioned this issue Aug 29, 2024
50 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 29, 2024
@NJ-2020
Copy link
Contributor

NJ-2020 commented Aug 29, 2024

PR Ready

cc: @paultsimura

@paultsimura
Copy link
Contributor

Deployed to production: #48231 (comment)
Payment is due on Sep 10

@garrettmknight garrettmknight added the Awaiting Payment Auto-added when associated PR is deployed to production label Sep 3, 2024
@garrettmknight garrettmknight changed the title [$250] Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over [HOLD for payment 2024-09-10] [$250] Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over Sep 3, 2024
@paultsimura
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: [Wave 8] Ideal nav  #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: 84071e8#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 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Sep 9, 2024
@garrettmknight garrettmknight removed the Reviewing Has a PR in review label Sep 11, 2024
@garrettmknight
Copy link
Contributor

Payment Summary:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants