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] Bank Account - After deleting the payment method in Wallet, it is displayed in the WS settings #53575

Open
2 of 8 tasks
vincdargento opened this issue Dec 4, 2024 · 14 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review Weekly KSv2

Comments

@vincdargento
Copy link

vincdargento commented Dec 4, 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.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.

  1. Navigate to Wallet
  2. Click on the 3-dot button
  3. 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
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864721429534820736
  • Upwork Job ID: 1864721429534820736
  • Last Price Increase: 2024-12-05
  • Automatic offers:
    • ishpaul777 | Reviewer | 105325226
    • twilight2294 | Contributor | 105325227
Issue OwnerCurrent Issue Owner: @ishpaul777
@vincdargento vincdargento added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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.

@lschurr lschurr added the External Added to denote the issue can be worked on by a contributor label Dec 5, 2024
@melvin-bot melvin-bot bot changed the title Bank Account - After deleting the payment method in Wallet, it is displayed in the WS settings [$250] Bank Account - After deleting the payment method in Wallet, it is displayed in the WS settings Dec 5, 2024
Copy link

melvin-bot bot commented Dec 5, 2024

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

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

melvin-bot bot commented Dec 5, 2024

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

@twilight2294
Copy link
Contributor

twilight2294 commented Dec 6, 2024

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

Copy link

melvin-bot bot commented Dec 9, 2024

@lschurr, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2024
@lschurr
Copy link
Contributor

lschurr commented Dec 9, 2024

Hi @ishpaul777 - could you review the proposal?

@ishpaul777
Copy link
Contributor

ishpaul777 commented Dec 9, 2024

Sure i'll review in couple hours

update: Will review tmrw..

@melvin-bot melvin-bot bot removed the Overdue label Dec 9, 2024
@ishpaul777
Copy link
Contributor

ishpaul777 commented Dec 11, 2024

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

Copy link

melvin-bot bot commented Dec 11, 2024

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

@marcochavezf
Copy link
Contributor

Sounds good, thanks for the review @ishpaul777, assigning @twilight2294 🚀

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

melvin-bot bot commented Dec 13, 2024

📣 @ishpaul777 🎉 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 Dec 13, 2024

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

@twilight2294
Copy link
Contributor

twilight2294 commented Dec 17, 2024

@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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Overdue labels Dec 17, 2024
@nkuoch nkuoch self-assigned this Dec 27, 2024
@nkuoch nkuoch added the Internal Requires API changes or must be handled by Expensify staff label Dec 27, 2024
@nkuoch
Copy link
Contributor

nkuoch commented Dec 27, 2024

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

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. External Added to denote the issue can be worked on by a contributor Internal Requires API changes or must be handled by Expensify staff Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants