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

[$500] both bank accounts are labeled as default after adding another BA for a moment #36944

Closed
1 of 6 tasks
m-natarajan opened this issue Feb 20, 2024 · 19 comments
Closed
1 of 6 tasks
Assignees
Labels
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 Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@m-natarajan
Copy link

m-natarajan commented Feb 20, 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: 1.4.43-0
Reproducible in staging?: y
Reproducible in production?: need to have real bank data
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @getusha
**Slack conversation:**https://expensify.slack.com/archives/C049HHMV9SM/p1708419649536799

Action Performed:

Account Settings > Wallet > Add Bank account
Add the first BA (checking)
Add the second BA (saving)

Expected result:

Only one of the accounts should be labeled as default

Actual result:

Both accounts are labeled as default

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Recording.2756.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f8029498cae4b95a
  • Upwork Job ID: 1760040653618905088
  • Last Price Increase: 2024-03-12
@m-natarajan m-natarajan added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 20, 2024
@melvin-bot melvin-bot bot changed the title both bank accounts are labeled as default after adding another BA for a moment [$500] both bank accounts are labeled as default after adding another BA for a moment Feb 20, 2024
Copy link

melvin-bot bot commented Feb 20, 2024

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

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

melvin-bot bot commented Feb 20, 2024

Triggered auto assignment to @miljakljajic (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

Copy link

melvin-bot bot commented Feb 20, 2024

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

@omarnagy91
Copy link

omarnagy91 commented Feb 20, 2024

Proposal

Problem Statement

We are currently experiencing an issue where both bank accounts are momentarily labeled as default after a user adds a second bank account in the Expensify app. This behavior is unexpected and can lead to confusion for the user, as only one bank account should be labeled as default at any given time.

Root Cause

Based on my review I believe that the root cause of this issue is a bug in the state management within the components that interact with the bank account addition process. Specifically, the logic responsible for updating the default status of bank accounts is not handling the addition of new bank accounts correctly.

Proposed Solution

To address this issue, I propose that we combine the following two solutions:

  1. Revise the state management logic in the components responsible for adding bank accounts. This includes ensuring that when a new bank account is added, the default status is only assigned to the newly added account if no other default exists, or it is explicitly set by the user.
  2. Add proper checks and balances to prevent multiple accounts from being labeled as default simultaneously.

Here is an example of how this could be implemented in the AddPersonalBankAccountPage.tsx file:

const handleSetDefaultAccount = (bankAccountID) => {
  const bankAccounts = getBankAccounts();
  const defaultBankAccountID = getDefaultBankAccountID();

  // Check if the account being set as default is already the default account.
  if (bankAccountID === defaultBankAccountID) {
    return;
  }

  // Check if there is already a default account.
  if (defaultBankAccountID) {
    // If there is already a default account, unset it.
    set({
      defaultBankAccountID: null,
    });
  }

  // Set the new account as the default account.
  set({
    defaultBankAccountID: bankAccountID,
  });
};

Benefits

The proposed solution is relatively straightforward to implement and maintain. It also aligns with the existing logic for managing default bank accounts in the app.

Conclusion

I believe that the proposed solution is the best approach to resolving this issue. It is simple to implement, aligns with the existing codebase, and effectively addresses the root cause of the problem.

@brunovjk
Copy link
Contributor

I believe this issue has the same cause as #34774 and #35788. @stitesExpensify is dealing with a backend solution that will resolve them.

@melvin-bot melvin-bot bot added the Overdue label Feb 23, 2024
@s101d1
Copy link

s101d1 commented Feb 24, 2024

I'm trying to reproduce this issue locally, but I can't add and log-in the personal bank account in local expensify app (https://dev.new.expensify.com:8082/) with Fidelity Bank method (it shows invalid credentials message when I tried to log-in), I can only log-in the Fidelity Bank account successfully in the staging. Is there a way to add and log-in the personal bank account in local dev environment?

@abdulrahuman5196
Copy link
Contributor

I believe this issue has the same cause as #34774 and #35788. @stitesExpensify is dealing with a backend solution that will resolve them.

@miljakljajic Seems to be a duplicate issue. We can close this.

@melvin-bot melvin-bot bot removed the Overdue label Feb 26, 2024
Copy link

melvin-bot bot commented Feb 27, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Feb 28, 2024
Copy link

melvin-bot bot commented Feb 29, 2024

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

@abdulrahuman5196
Copy link
Contributor

I believe this issue has the same cause as #34774 and #35788. stitesExpensify is dealing with a backend solution that will resolve them.

@miljakljajic Seems to be a duplicate issue. We can close this.

@miljakljajic gentle ping

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Mar 1, 2024
Copy link

melvin-bot bot commented Mar 4, 2024

@miljakljajic, @abdulrahuman5196 Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Mar 5, 2024

@miljakljajic @abdulrahuman5196 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Mar 5, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Mar 5, 2024

@miljakljajic @abdulrahuman5196 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Mar 6, 2024

@miljakljajic, @abdulrahuman5196 Huh... This is 4 days overdue. Who can take care of this?

@stitesExpensify stitesExpensify added Weekly KSv2 and removed Daily KSv2 labels Mar 7, 2024
@melvin-bot melvin-bot bot removed the Overdue label Mar 7, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Mar 12, 2024

@miljakljajic @abdulrahuman5196 this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

Copy link

melvin-bot bot commented Mar 15, 2024

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

@miljakljajic
Copy link
Contributor

Apologies for missing this - closing!

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 Engineering 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
None yet
Development

No branches or pull requests

7 participants