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

[$250] Connect Bank Account - Disconnected bank account reappears after re-enabling Payments. #54612

Open
2 of 8 tasks
IuliiaHerets opened this issue Dec 27, 2024 · 13 comments
Open
2 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 27, 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.79-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Web, mweb
App Component: Workspace Settings

Action Performed:

Precondition - Workspace is created and a fully verified bank account has been added

  1. Go to https://staging.new.expensify.com/
  2. Go to the workspace settings and click on workflows
  3. Click on the bank account and click on disconnect then confirm
  4. Disable and then enable payments
  5. Click on "Connect bank account"

Expected Result:

The previously disconnected bank account should no longer be visible when attempting to reconnect a bank account in step 5.

Actual Result:

The bank account that was previously disconnected reappears after disabling and re-enabling Payments.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6702810_1735286733111.bandicam_2024-12-27_11-04-32-203.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021873775484989346815
  • Upwork Job ID: 1873775484989346815
  • Last Price Increase: 2024-12-30
Issue OwnerCurrent Issue Owner: @s77rt
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 27, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

Triggered auto assignment to @laurenreidexpensify (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 Overdue label Dec 30, 2024
@M00rish
Copy link
Contributor

M00rish commented Dec 30, 2024

Edited by proposal-police: This proposal was edited at 2024-12-30 11:32:32 UTC.

Proposal

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

Connect Bank Account - Disconnected bank account reappears after re-enabling Payments.

What is the root cause of that problem?

when the toggle is on we set up a new workspace Reimbursement without checking if there's a bank account or not in the policy:

const newReimburserEmail = policy?.achAccount?.reimburser ?? policy?.owner;
Policy.setWorkspaceReimbursement(route.params.policyID, newReimbursementChoice, newReimburserEmail ?? '');
},

Basically after we delete BankAccount and when we switch toggle off and on we add back a new one

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

we need to check when toggle is enabled if there's bank account in 'policy' only then we call setWorkspaceReimbursement.

                   if(policy.achAccount){
                    const newReimburserEmail = policy.achAccount?.reimburser ?? policy?.owner;
                    Policy.setWorkspaceReimbursement(route.params.policyID, newReimbursementChoice, newReimburserEmail ?? '');
                    }
                },

Could be improve in PR phase

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

add test to check that component does not call setWorkspaceReimbursement when toggle enabled and there's no bank account and vice versa

What alternative solutions did you explore? (Optional)

@laurenreidexpensify laurenreidexpensify added the External Added to denote the issue can be worked on by a contributor label Dec 30, 2024
@melvin-bot melvin-bot bot changed the title Connect Bank Account - Disconnected bank account reappears after re-enabling Payments. [$250] Connect Bank Account - Disconnected bank account reappears after re-enabling Payments. Dec 30, 2024
Copy link

melvin-bot bot commented Dec 30, 2024

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

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

melvin-bot bot commented Dec 30, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Dec 30, 2024
@s77rt
Copy link
Contributor

s77rt commented Dec 30, 2024

@M00rish Thanks for the proposal. Your RCA is not correct. After calling requestResetFreePlanBankAccount a modal is shown and it's confirm handler calls resetFreePlanBankAccount which should delete the bank account. Can you check why this is not the case here?

onConfirm={() => BankAccounts.resetFreePlanBankAccount(bankAccountID, session, achData?.policyID ?? '-1')}

@M00rish
Copy link
Contributor

M00rish commented Dec 30, 2024

@s77rt I have updated my proposal, can you please review again thanks.

@laurenreidexpensify
Copy link
Contributor

@muttmuure adding this as medium but i'll leave it to you to modify if you think otherwise 👍

@s77rt
Copy link
Contributor

s77rt commented Dec 31, 2024

@M00rish Thanks for the update. I'm not sure how your RCA is related here. Did you check if the bank account gets deleted after confirming the modal? (i.e. an API request is made)

Also the API you referenced does not add anything new, it already uses policy.achAccount?.reimburser if available

@M00rish
Copy link
Contributor

M00rish commented Dec 31, 2024

Did you check if the bank account gets deleted after confirming the modal?

yes this API command gets executed RESTART_BANK_ACCOUNT_SETUP.

when hit confirm disconnect, the bank account is deleted from policy and reimbursementAccount, but when toggle off and on setWorkspaceReimbursement set reimbursementAccount back again in onyx.

bandicam.2024-12-31.18-34-13-412.mp4

plus the EnableBankAccount.tsx component takes reimbursementAccount prop from parent ReimbursementAccountPage.tsx
which in turns takes it directly from onyx, that's why we see it back again.

that's why even after creating a new workspace and not connecting any bank account to it, just toggle off and on was enough to add bank account

i think either rely on policy.achaccount in EnableBankAccount

or change from BE reimbursementAccount to be key-value array that would have the policyID and bank account associated with it and then we'll have change both EnableBankAccount.tsx and ReimbursementAccountPage.tsx (and others if needed)
to deal with this change

@s77rt
Copy link
Contributor

s77rt commented Dec 31, 2024

@M00rish Looks to be BE related.

PS: You can only have one business bank account linked (all the workspaces use that same bank)

@s77rt
Copy link
Contributor

s77rt commented Dec 31, 2024

🎀 👀 🎀 Internal

Copy link

melvin-bot bot commented Dec 31, 2024

Triggered auto assignment to @arosiclair, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@s77rt
Copy link
Contributor

s77rt commented Dec 31, 2024

👋 @arosiclair Can you please check why BE SetWorkspaceReimbursement method returns a "disconnected" reimbursementAccount?
You may want to check if RestartBankAccountSetup actually deleted that bank in the first place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Development

No branches or pull requests

5 participants