Skip to content

[HOLD for payment 2024-10-30] Expensify Card - Cards are not assigned in table for newly created accounts #50248

Closed

Description

@isagoico

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.44-8

Reproducible in staging?: Yes
Reproducible in production?: Yes

If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/cases/view/3272217
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856

Issue reported by: Applause - Internal team

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with a new Expensifail account
  3. Create a workspace
  4. Navigate to Workspace settings - More features
  5. Enable "Expensify Card"
  6. Navigate to Workspace settings - Members
  7. Invite a Gmail address that doesn't have an account yet
  8. Navigate to Workspace settings - Expensify Card
  9. Click on the "Issue new card" button
  10. Add bank account details and finish the BA flow
  11. Click on the "Issue new card" button
  12. Select the new member
  13. Select "Virtual card"
  14. Add the card with any limit type, limit and name
  15. Navigate to Workspace settings - Members
  16. Click on the member added in step 7

Expected Result:

After assigning the card, it should be displayed in the cards table and assigned to the member.

Actual Result:

The virtual card is missing from the "Expensify Card" page and also from the workspace member profile page. I'm also unable to add a virtual card with the Workspace Member profile - New card flow.

Workaround:

No workaround found. No way to issue Ecards to new members

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

Recording.842.mp4
Bug6624360_1728044115080.Member_-_New_card.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @garrettmknight

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 4, 2024
  2. melvin-bot commented on Oct 4, 2024

    @melvin-bot

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

  3. isagoico commented on Oct 4, 2024

    @isagoico
    Author

    Note: We're able to assign cards to existing accounts. Take the following example from a test workspace:
    I'm able to assign cards to applausetester+ig1@applause.expensifail.com but not to isagoicotest+newtest@gmail.com (new account.

    image

  4. twilight2294 commented on Oct 4, 2024

    @twilight2294
    Contributor

    Proposal

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

    Cards are not assigned in table for newly created accounts

    What is the root cause of that problem?

    The API response is not successful for new users with unvalidated account:

    Screenshot 2024-10-05 at 2 46 59 AM

    The card never gets assigned hence it doesn't get showed in table or member profile page.

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

    We should block the action to create virtual cards for unvalidated accounts. we can do so by showing the issuer a modal or by not showing the new user in the search list at all.

    (for modal, we would need the design of how the error should look) and (for not showing we can just filter the list of assignees available by filtering out the unvalidated accounts here

    Same can be done for other company card page if bug exists there too:
    We will return early if the account is unvalidated:

    Object.entries(policy.employeeList ?? {}).forEach(([email, policyEmployee]) => {
    if (PolicyUtils.isDeletedPolicyEmployee(policyEmployee, isOffline)) {
    return;
    }

    const membersDetails = useMemo(() => {

    What alternative solutions did you explore? (Optional)

  5. cretadn22 commented on Oct 5, 2024

    @cretadn22
    Contributor

    Proposal

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

    Can't create a virtual card for an unvalidated account.

    What is the root cause of that problem?

    When attempting to create a virtual card for an unvalidated account, the backend returns the error message: "The assignee account has not been validated." However, this issue does not occur when creating a physical card. We should verify whether we need to prevent users from creating a physical card for an unvalidated account as well.

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

    1. In the assignee step page, we should filter out all unvalidated accounts from the list
      const personalDetail = PersonalDetailsUtils.getPersonalDetailByEmail(email);
                if (personalDetail?.validated === false) {
                    return;
                }
    

    I noticed that we have two files:

    • src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx
    • src/pages/workspace/companyCards/assignCard/AssigneeStep.tsx

    The logic for retrieving the sections list in both files is identical. I recommend creating a utility function to obtain the assignee section and using it in both files.

    1. In the Member Detail Page
    • We can disable the Issue Card button and show a label explaining why we can't issue a new card for this user. I believe this approach offers a better user experience by clearly communicating the reason for the restriction
    23
    • The second option is to show a modal when the user tries to issue a card to an unvalidated account
    05

    What alternative solutions did you explore? (Optional)

  6. twilight2294 commented on Oct 5, 2024

    @twilight2294
    Contributor

    @cretadn22 what exactly is different in your proposal than mine? I can just see that you have elaborated on what I wrote as a brief :)) and we require that every proposal should be unique

    We have that in contributor guidelines as well:

    Screenshot 2024-10-05 at 10 37 18 AM

    c.c. @dylanexpensify

  7. mountiny commented on Oct 6, 2024

    @mountiny
    Contributor

    @isagoico can you please share the email used here and check if the accounts been validated or not? If you can see the response of the call that would be helpful in future too, whenever something is not happening as expected add console logs and network logs. Thanks

  8. cretadn22 commented on Oct 7, 2024

    @cretadn22
    Contributor

    @mountiny I believe my proposal answers your question.

    When attempting to create a virtual card for an unvalidated account, the backend returns the error message: "The assignee account has not been validated." However, this issue does not occur when creating a physical card. We should verify whether we need to prevent users from creating a physical card for an unvalidated account as well.

    Should we allow assigning physical and virtual cars to unvalidated accounts?

  9. 34 remaining items

  10. melvin-bot commented on Oct 22, 2024

    @melvin-bot

    @garrettmknight, @koko57, @mountiny, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  11. koko57 commented on Oct 23, 2024

    @koko57
    Contributor

    PR is merged, this issue can be retested

  12. mountiny commented on Oct 23, 2024

    @mountiny
    Contributor

    Asked for a retest here

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 23, 2024
  14. changed the title [-]Expensify Card - Cards are not assigned in table for newly created accounts[/-] [+][HOLD for payment 2024-10-30] Expensify Card - Cards are not assigned in table for newly created accounts[/+] on Oct 23, 2024
  15. melvin-bot commented on Oct 23, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  16. melvin-bot commented on Oct 23, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.52-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2024-10-30. 🎊

    For reference, here are some details about the assignees on this issue:

    • @koko57 does not require payment (Contractor)
    • @DylanDylann requires payment (Needs manual offer from BZ)
  17. melvin-bot commented on Oct 23, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
    • [@DylanDylann] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • [@DylanDylann] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • [@DylanDylann] Determine if we should create a regression test for this bug.
    • [@DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@garrettmknight] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  18. mountiny commented on Oct 24, 2024

    @mountiny
    Contributor

    The regression test for this was already handled as part of the workspace feeds project. The fix was in backend to ensure we return the card in the https response too so it show sup immediately.

    I think we can close this one out as we have handled the payments for the project already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.WeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions