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] Expensify Card - Settlement account is blank when second admin accesses the page #52950

Open
8 tasks done
IuliiaHerets opened this issue Nov 22, 2024 · 38 comments
Open
8 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 22, 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.65-4
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Email or phone of affected tester (no customers): applausetester [email protected]
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Expensify Card feature is enabled.
  • Bank account is set up in the workspace.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Members.
  3. Invite another user and promote to admin.
  4. Log in as admin.
  5. Go to workspace settings > Expensify Card.
  6. Click Settings.
  7. Click Settlement account.

Expected Result:

Settlement account will not be blank.

Actual Result:

Settlement account is blank when second admin accesses the page.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6672831_1732266725247.20241122_170725.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021861520764980845600
  • Upwork Job ID: 1861520764980845600
  • Last Price Increase: 2024-12-03
  • Automatic offers:
    • DylanDylann | Contributor | 105192011
Issue OwnerCurrent Issue Owner: @mountiny
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 22, 2024
Copy link

melvin-bot bot commented Nov 22, 2024

Triggered auto assignment to @JmillsExpensify (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 Nov 25, 2024
@twilight2294
Copy link
Contributor

Proposal

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

Settlement account is blank when second admin accesses the page

What is the root cause of that problem?

Currently on the expensify cards settings page, we get the current users personal bank account details:

const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST);

App/src/ONYXKEYS.ts

Lines 262 to 263 in 51e25af

/** The user's bank accounts */
BANK_ACCOUNT_LIST: 'bankAccountList',

Hence we do not see current bank selected.

But here we need the current policy account details and not individual, hence from admin account the field is shown as blank.

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

To fix it, firstly we should get the bank account data from policy?.achAccount and then display that in the settings page:

  1. So in WorkspaceCardSettingsPage:
    function WorkspaceCardSettingsPage({route}: WorkspaceCardSettingsPageProps) {

    const bankAccountNumber = bankAccountList?.[paymentBankAccountID.toString()]?.accountData?.accountNumber ?? '';

We need to get the achAccount data and get the bank account number from there:

const bankAccountNumber = policy?.achAccount?.accountNumber ?? '';
  1. Then in WorkspaceSettlementAccountPage, we have multiple options.

a) Either disable this page for admins, This is because now we will get the admin's bank accounts rather than the owners.
b) If we want to allow the settlement accounts to be changed to the admins bank account then the current implementation works, but with a catch that if there is no bank account added by the admin then we should show an empty RHP stating that please add a bank account.

I think option A is more appropriate here given that we do not want the admin to add their own bank account

What alternative solutions did you explore? (Optional)

Copy link

melvin-bot bot commented Nov 26, 2024

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

@JmillsExpensify JmillsExpensify added the External Added to denote the issue can be worked on by a contributor label Nov 26, 2024
@melvin-bot melvin-bot bot changed the title Expensify Card - Settlement account is blank when second admin accesses the page [$250] Expensify Card - Settlement account is blank when second admin accesses the page Nov 26, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

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

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

Opening up to the community

Copy link

melvin-bot bot commented Nov 26, 2024

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

Copy link

melvin-bot bot commented Dec 2, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@twilight2294
Copy link
Contributor

@eh2077 can you please review my proposal here

@eh2077
Copy link
Contributor

eh2077 commented Dec 2, 2024

@twilight2294 I have trouble to setup Expensify Card. Can you share steps to setup Expensify Card?

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
@twilight2294
Copy link
Contributor

Connect this bank account and then assign expensify cards from workspace. that's all i did to reproduce this issue
Screenshot 2024-12-03 at 6 47 17 PM

@eh2077
Copy link
Contributor

eh2077 commented Dec 3, 2024

I managed to reproduce the bug.

@twilight2294 's proposal looks good to me. Let's go with their proposal!

🎀👀🎀 C reviewed

Copy link

melvin-bot bot commented Dec 3, 2024

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

@DylanDylann
Copy link
Contributor

@eh2077 Sorry, I am not sure that policy?.achAccount is existing

@DylanDylann
Copy link
Contributor

Coincidentally I'm also following this because it's part of the Expensify Card feature which I've been in charge of since the beginning.

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 3, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

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

@twilight2294
Copy link
Contributor

twilight2294 commented Dec 3, 2024

achAccount

@DylanDylann don't worry i have checked thoroughly it exists below:

App/src/types/onyx/Policy.ts

Lines 1801 to 1802 in 01d5233

/** The verified bank account linked to the policy */
achAccount?: ACHAccount;

We already use a similar check here:

const hasValidAccount = !!policy?.achAccount?.accountNumber;

My solutions solves this bug efficiently , @Beamanator can you assign me here please as per summary by C . Also if you have any doubts then let me know, i can answer then

@mountiny
Copy link
Contributor

mountiny commented Dec 4, 2024

Started a thread here

@mountiny
Copy link
Contributor

mountiny commented Dec 4, 2024

@twilight2294 we need to discuss this internally first to know the right expectations

@Beamanator
Copy link
Contributor

Thank you for taking over, kind sir @mountiny 🙏

@eh2077
Copy link
Contributor

eh2077 commented Dec 4, 2024

@DylanDylann Would you like take over this as C as you have more context about the feature? Thanks 🙏

@DylanDylann
Copy link
Contributor

@eh2077 IMO, this issue may need to be fixed on the BE side, I can help to take over it and follow the discussion

@twilight2294
Copy link
Contributor

@twilight2294 we need to discuss this internally first to know the right expectations

Okay, I will update the proposal when the expected result is updated, thanks

@mountiny mountiny assigned DylanDylann and unassigned eh2077 Dec 4, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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

@DylanDylann
Copy link
Contributor

We decided to fix this issue on the BE here. When it is done, I will retest this issue

Copy link

melvin-bot bot commented Dec 6, 2024

@JmillsExpensify @mountiny @DylanDylann 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!

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@mountiny mountiny added Weekly KSv2 Daily KSv2 Internal Requires API changes or must be handled by Expensify staff and removed Daily KSv2 Weekly KSv2 External Added to denote the issue can be worked on by a contributor labels Dec 8, 2024
@mountiny
Copy link
Contributor

mountiny commented Dec 8, 2024

This is internal but not as high priority so making weekly

@melvin-bot melvin-bot bot added the Overdue label Dec 11, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

@JmillsExpensify, @mountiny, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

@mountiny mountiny added Weekly KSv2 and removed Daily KSv2 labels Dec 12, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 12, 2024
@mountiny
Copy link
Contributor

Havent started on the BE fix

@melvin-bot melvin-bot bot added the Overdue label Dec 23, 2024
@mountiny
Copy link
Contributor

No updates

@melvin-bot melvin-bot bot removed the Overdue label Dec 23, 2024
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. Internal Requires API changes or must be handled by Expensify staff Weekly KSv2
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

8 participants