[HOLD for payment 2024-09-10] [$250] Workspace - RBRs displayed on every workspace after quitting adding bank VBA & starting over
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:
- Open the app and log in with the account that has several workspaces
- Navigate to workspace settings > More features
- Enable workflows
- Open workflows > Connect bank account
- Select "Connect online with Plaid"
- Select Regions and continued adding VBA
- Quit the flow half way
- Navigate to Workflows > Connect bank account
- Select start over
- 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
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 Owner
Current Issue Owner: @paultsimura
Triggered auto assignment to @dangrous (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
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.
: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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
We think that this bug might be related to #wave-collect - Release 1
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)
Job added to Upwork: https://www.upwork.com/jobs/~0180cfb0a524c49cdc
Triggered auto assignment to Contributor-plus team member for initial proposal review - @paultsimura (External)
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?
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
Reviewing now π
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
Current assignee @dangrous is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.
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 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 Thank you for clarifying. I appreciate it!
works for me! assigning @NJ-2020
π£ @paultsimura π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @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 π
PR Ready
cc: @paultsimura
Deployed to production: https://github.com/Expensify/App/pull/48231#issuecomment-2325378456 Payment is due on Sep 10
- 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
- Open the app and log in with the account that has several workspaces
- Navigate to workspace settings > More features
- Enable workflows
- Open workflows > Connect bank account
- Select "Connect online with Plaid"
- Select "Regions bank" and continue adding VBA
- Quit the flow half-way
- Navigate to Workflows > Connect bank account
- Select "start over"
- Navigate to the list of workspaces
- Verify that there's no RBR in the workspaces list
Do we agree π or π
Payment Summary:
- Contributor: @NJ-2020 $250 paid via Upwork
- Reviewer: @paultsimura $250 paid via Upwork