[$250] Bank Account - After deleting the payment method in Wallet, it is displayed in the WS settings
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.71-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: n/a Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team
Action Performed:
Preconditions: user must be logged in, have created a collect workspace and have connected a bank account.
- Navigate to Wallet
- Click on the 3-dot button
- Click on Delete
Expected Result:
The payment account is not displayed in the workspace settings after deleting it.
Actual Result:
After deleting the payment method in Wallet, it's displayed in the WS settings
Workaround:
Unknown
Platforms:
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [ ] Android: mWeb Chrome
- [ ] iOS: Standalone
- [ ] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [x] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/fe0c4d6a-b27e-41c1-87ee-e71d4e94560d
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021864721429534820736
- Upwork Job ID: 1864721429534820736
- Last Price Increase: 2024-12-05
Issue Owner
Current Issue Owner: @ishpaul777
Triggered auto assignment to @lschurr (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.
Job added to Upwork: https://www.upwork.com/jobs/~021864721429534820736
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ishpaul777 (External)
Edited by proposal-police: This proposal was edited at 2024-12-06 06:08:18 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After deleting the payment method in Wallet, it is displayed in the WS settings
What is the root cause of that problem?
We do not clear the achAccount on policies where the deleted bank account exist on the FE as well as the BE
What changes do you think we should make in order to solve the problem?
When we delete bank account here, we should get all the policies and check if anywhere achAccount exist and the bank account number is the same as the one being delete, and if so then clear the achAccount data for that policy, we need BE changes as well here, we need to make the following changes here:
Onyx.connect({
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
});
Object.values(allPolicies ?? {}).forEach((policy) => {
if (policy?.achAccount && policy?.achAccount?.bankAccountID === bankAccountID) {
onyxData?.optimisticData?.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}`,
value: {
...allPolicies,
[policy.id]: {
...policy,
achAccount: null,
},
},
});
onyxData?.failureData?.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}`,
value: {
...allPolicies,
},
})
}
});
Note that during PR phase we might have to adjust the mapping a bit but this is the approach we need to follow, we might need to add success data as well, this is just overview, details can be done during PR phase
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A this is related to data change, but we can surely have a unit test if needed, we would just need to mock data and expect appropriate policy data
What alternative solutions did you explore? (Optional)
N/A
@lschurr, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Hi @ishpaul777 - could you review the proposal?
Sure i'll review in ~couple hours~
update: Will review tmrw..
I think proposal from @twilight2294 should work on FE side but i'll bring a internal engineer to decide if backend changes are plausible.
π π π C+ reviewed
Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Sounds good, thanks for the review @ishpaul777, assigning @twilight2294 π
π£ @ishpaul777 π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @twilight2294 π 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 π
@marcochavezf are the BE changes ready for this one ?
Also please take a look at these comments: https://github.com/Expensify/App/pull/54235/files#r1888100521
I'll send an auth PR for it, so we remove the achAccount from the policy if no other reimburser owning this bank account exit in the policy
any update here?
Auth PR was merged last week. Can you retest? Bank account should be removed from the workspace when deleted from personal settings (as long as no other workspace admin owns it too).
This issue has not been updated in over 15 days. @nkuoch, @marcochavezf, @lschurr, @ishpaul777, @twilight2294 eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
please close this