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

[Workspace Feeds] [$250] Card - "Account ending in" message appears after adding bank account for the card #45729

Closed
1 of 6 tasks
m-natarajan opened this issue Jul 18, 2024 · 51 comments
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

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 18, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Issue found when validating #45388
Version Number: 9.0.9-1
Reproducible in staging?: Y
Reproducible in production?: N
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: Applause Internal Team
Slack conversation:

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with a new expensifail account
  3. Create a workspace and set default currency to USD
  4. Navigate to Workspace settings - More features
  5. Enable Expensify Card
  6. Navigate to Expensify Card
  7. Click on "Issue new card" button
  8. Click on "Connect online with Plaid"
  9. Complete BA flow with Regions bank
  10. Click on "Issue new card" button

Expected Result:

The account holders name and the accounts last four number should be showing.

Actual Result:

"Account ending in" message appears after adding bank account for the card. You have to relog for the correct info to load.

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

Bug6546472_1721325256811.bandicam_2024-07-18_19-31-14-209.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01622f31aad5cbea6e
  • Upwork Job ID: 1814111023366877998
  • Last Price Increase: 2024-07-26
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 18, 2024
Copy link

melvin-bot bot commented Jul 18, 2024

Triggered auto assignment to @kadiealexander (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.

@m-natarajan
Copy link
Author

@kadiealexander FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@m-natarajan
Copy link
Author

We think that this bug might be related to #wave-collect - Release 2

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Jul 19, 2024
@melvin-bot melvin-bot bot changed the title Card - "Account ending in" message appears after adding bank account for the card [$250] Card - "Account ending in" message appears after adding bank account for the card Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

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

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

melvin-bot bot commented Jul 19, 2024

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

@kadiealexander kadiealexander moved this to Release 2: Summer 2024 (Aug) in [#whatsnext] #wave-collect Jul 19, 2024
@nyomanjyotisa
Copy link
Contributor

Proposal

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

"Account ending in" message appears after adding bank account for the card

What is the root cause of that problem?

After adding new bank account from Expensify Card page, the bankAccounts onyx data given by the API not formatted properly and we didn't fetch the properly formatted bankAccounts onyx data as we do in the wallet page

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

Add the following code after AcceptACHContractForBankAccount API Write here to make sure we got the properly formatted bankAccounts onyx data after adding new bank account from Expensify Card page

PaymentMethods.openWalletPage();

OR

API.read(READ_COMMANDS.OPEN_PAYMENTS_PAGE, null);

And need to update here to properly get the right bankName and bankAccountOwnerName, to make sure we displayed the bank icon

        return eligibleBankAccounts.map((bankAccount) => {
            const bankName = bankAccount.accountData?.additionalData?.bankName;
            const bankAccountOwnerName = bankAccount.accountData?.addressName;
            const formattedBankAccountNumber = bankAccount.accountData?.accountNumber
                ? `${translate('workspace.expensifyCard.accountEndingIn')} ${bankAccount.accountData?.accountNumber.slice(-4)}`
                : '';

            const {icon, iconSize, iconStyles} = getBankIcon({bankName, styles});

            return (
                <MenuItem
                    title={bankAccountOwnerName}
                    description={formattedBankAccountNumber}
                    onPress={handleSelectBankAccount}
                    icon={icon}
                    iconHeight={iconSize}
                    iconWidth={iconSize}
                    iconStyles={iconStyles}
                    shouldShowRightIcon
                    displayInDefaultIconColor
                />
            );
        });

What alternative solutions did you explore? (Optional)

  • Fix the AcceptACHContractForBankAccount API response on BE to return the properly formatted bankAccountList onyx data
  • And also need to do the same as main solution to display the bank icon properly

RESULT
image

@VasylMartyniv
Copy link

VasylMartyniv commented Jul 22, 2024

Proposal

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

Account details not being correctly displayed after adding new account. The account's data is not being passed properly to the item in a list.

What is the root cause of that problem?

The eligibleBankAccounts mapping function that maps bankAccountList to menu items, is trying to use some values from bankAccount.accountData which are not present in that object after adding the account.

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

For displaying the data in menu item we can use the values from bankAccountList item iteself. So the proposed changes are next:

  • For the display of Name and Account number use the data from bankAccount object, and not from bankAccount.accountData.
    • Use bankAccount.description.slice(-4) for the bankAccountNumber variable
    • Use bankAccount.title for the Account Holder name in the menu item
  • Because the bankName property is present directly in the accountData object after adding a new account, we can add a conditional that will use the bankName variable from accountData.bankName, and if that is missing then use a value from accountData.additionalData.bankName.
  • Adjust "AccountData" type, as the property bankName can be present both in AccountData type or the BankAccountAdditionalData type, depending on the response that provides bankAccountList.

All of the above variables are already accessible in bankAccountList items after adding a new account, so no additional fetching needed.

What alternative solutions did you explore? (Optional)

  • Additional fetching of the missing data after adding new card
  • Adjusting the back-end responses to have a consistent bankAccount object structure that they return.

Result of proposed changes:

Screenshot 2024-07-22 at 4 31 15 PM

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
Copy link

melvin-bot bot commented Jul 22, 2024

📣 @VasylMartyniv! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@VasylMartyniv
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~018d00e8b30180eee9

Copy link

melvin-bot bot commented Jul 22, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@s77rt
Copy link
Contributor

s77rt commented Jul 22, 2024

@nyomanjyotisa

the bankAccounts onyx data given by the API not formatted properly

Can you elaborate how not formatted? (include returned data vs expected data)

@melvin-bot melvin-bot bot removed the Overdue label Jul 22, 2024
@s77rt
Copy link
Contributor

s77rt commented Jul 22, 2024

@VasylMartyniv

trying to use some values from bankAccount.accountData which are not present in that object after adding the account

Why do we have missing fields? And are the rest of the fields returned by the backend or populated optimistically?

Copy link

melvin-bot bot commented Jul 25, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Jul 25, 2024
@s77rt
Copy link
Contributor

s77rt commented Jul 25, 2024

Waiting on proposals

@melvin-bot melvin-bot bot removed the Overdue label Jul 25, 2024
Copy link

melvin-bot bot commented Jul 26, 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 Jul 31, 2024

@s77rt, @kadiealexander Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2024
Copy link

melvin-bot bot commented Aug 15, 2024

@iwiznia @s77rt @koko57 @kadiealexander this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@s77rt
Copy link
Contributor

s77rt commented Aug 15, 2024

Same ^

Copy link

melvin-bot bot commented Aug 19, 2024

@iwiznia, @s77rt, @koko57, @kadiealexander 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 Aug 19, 2024
@s77rt
Copy link
Contributor

s77rt commented Aug 19, 2024

Same ^

@melvin-bot melvin-bot bot removed the Overdue label Aug 19, 2024
@koko57
Copy link
Contributor

koko57 commented Aug 20, 2024

@s77rt more explaination here: #47239 (comment)

The issue with the data not being sent the same way is solved, but we still need to make one fix here.
We need to change bankAccount.accountData?.accountNumber for bankAccount.accountData?.additionalData?.mask

const bankAccountNumber = bankAccount.accountData?.accountNumber ?? '';

and use the mask without additionally using getLastFourDigits

description={`${translate('workspace.expensifyCard.accountEndingIn')} ${getLastFourDigits(bankAccountNumber)}`}

@s77rt
Copy link
Contributor

s77rt commented Aug 20, 2024

@koko57 Thanks! Let's wait for @mountiny on this one, for consistency I think we may want the accountNumber

@koko57
Copy link
Contributor

koko57 commented Aug 22, 2024

@mountiny waiting for your decision here 🙂 Personally I would go with changing this to mask regardless if the accountNumber is added or not, because we could get rid of getLastFourDigits calculation and mask is something that should be returned for every card

@mountiny mountiny self-assigned this Aug 23, 2024
@mountiny
Copy link
Contributor

We should work on unifying how we send the data from those two commands, I created a task to do that here #47944

I got a quick PR to add the masked accountNumber to the response here too so we can keep the behaviour unified.

@koko57
Copy link
Contributor

koko57 commented Aug 26, 2024

@mountiny should I make this change with mask that I proposed anyway? or are we going with just the backend fix?

@melvin-bot melvin-bot bot added the Overdue label Aug 26, 2024
@mountiny
Copy link
Contributor

Lets just wait for the backend fix so we do not handle this differently in two places

Copy link

melvin-bot bot commented Aug 27, 2024

@iwiznia, @s77rt, @koko57, @mountiny, @kadiealexander Huh... This is 4 days overdue. Who can take care of this?

@mountiny
Copy link
Contributor

@koko57 the fix is deployed, can you retest it?

@koko57
Copy link
Contributor

koko57 commented Aug 28, 2024

the same as in #47239 (comment)

@kadiealexander
Copy link
Contributor

Not overdue

@melvin-bot melvin-bot bot removed the Overdue label Aug 28, 2024
@mountiny
Copy link
Contributor

Follow up backend PR merged

@melvin-bot melvin-bot bot added the Overdue label Aug 30, 2024
@kadiealexander
Copy link
Contributor

@mountiny is there anything else left to complete on this issue?

@melvin-bot melvin-bot bot removed the Overdue label Sep 2, 2024
@mountiny
Copy link
Contributor

mountiny commented Sep 2, 2024

@koko57 We had to make one small backend change and that should have been deployed. Can you please confirm if there is anything left to do for this one? Thank you 🙇

@koko57
Copy link
Contributor

koko57 commented Sep 2, 2024

Screenshot 2024-09-02 at 14 06 22 it's working now - ending in number is displayed

cc @mountiny

@mountiny
Copy link
Contributor

mountiny commented Sep 2, 2024

Perfect, this is fixed now then, thank you for confirming!

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
Projects
Status: Done
Development

No branches or pull requests

8 participants