Skip to content

[Due for payment 2026-08-17] Error when assigning Expensify card to phone number user invited during issue card flow #80874

Closed

Description

@jponikarchuk

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.3.11-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-3776/folder/13176890/41237378/1155362779
Email or phone of affected tester (no customers): applausetester+280101abc@applause.expensifail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition:

  • Workspace is set up with Expensify card feature.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Expensify Card.
  3. Click Issue card.
  4. On cardholder step, enter a phone number (60128323983), select the phone number and click Invite.
  5. Complete the rest of the steps and reach confirm page.
  6. On confirm page, click Issue card.
  7. Enter magic code.

Expected Result:

The card will be assigned successfully.

Actual Result:

Error "Oops... something went wrong and your request could not be completed. Please try again later." shows up when assigning Expensify card to phone number user invited during issue card flow.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 29, 2026
  2. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 29, 2026
  3. melvin-bot commented on Jan 29, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 29, 2026

    @melvin-bot

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

  5. daledah commented on Jan 29, 2026

    @daledah
    Contributor

    Proposal

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

    When issuing an Expensify card to a user who was invited via phone number during the card issuance flow, an error "Oops... something went wrong and your request could not be completed. Please try again later." appears after entering the magic code.

    Actual: Error shows up when assigning Expensify card to phone number user

    What is the root cause of that problem?

    The root cause is a mismatch between the assigneeEmail format used in the card issuance API and the actual login format stored in the backend.

    When a user selects a phone number to invite:

    1. In AssigneeStep.tsx, the invitingMemberEmail is set to the raw phone number (e.g., +15551234567):

    if (!policy?.employeeList?.[assignee?.login ?? '']) {
    setIssueNewCardStepAndData({
    step: CONST.EXPENSIFY_CARD.STEP.INVITE_NEW_MEMBER,
    data: {
    currency,
    invitingMemberEmail: assignee?.login ?? '',
    invitingMemberAccountID: assignee?.accountID ?? undefined,
    },
    policyID,
    });
    setDraftInviteAccountID(data.assigneeEmail, assignee?.accountID ?? undefined, policyID);
    return;

    1. In InviteNewMemberStep.tsx, the assigneeEmail is set from invitingMemberEmail (still raw phone number):

    } else {
    setIssueNewCardStepAndData({
    step: CONST.EXPENSIFY_CARD.STEP.CARD_TYPE,
    isEditing: false,
    policyID,
    data: {...issueNewCard?.data, assigneeEmail: issueNewCard?.data?.invitingMemberEmail ?? '', invitingMemberEmail: undefined},
    });

    1. When the member is invited via addMembersToWorkspace, the phone number IS correctly converted to SMS domain format (e.g., +15551234567@expensify.sms):

    const logins = Object.keys(invitedEmailsToAccountIDs).map((memberLogin) => PhoneNumber.addSMSDomainIfPhoneNumber(memberLogin));

    1. When issueExpensifyCard is called, it sends the raw phone number as assigneeEmail:

    const parameters = {
    assigneeEmail,
    limit,
    limitType,
    cardTitle,
    validateCode,
    domainAccountID,
    };

    The backend cannot find a user with login +15551234567 because the actual login in the system is +15551234567@expensify.sms, causing the API to fail with a generic error.

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

    Convert the assigneeEmail to SMS domain format before sending to the API in issueExpensifyCard function:

    src/libs/actions/Card.ts:

    +import {addSMSDomainIfPhoneNumber} from './PhoneNumber';
     // ... existing imports
    
    function issueExpensifyCard(domainAccountID: number, policyID: string | undefined, feedCountry: string, validateCode: string, data?: IssueNewCardData) {
        if (!data) {
            return;
        }
    
        const {assigneeEmail, limit, limitType, cardTitle, cardType} = data;
    +   const normalizedAssigneeEmail = addSMSDomainIfPhoneNumber(assigneeEmail);
    
        // ... optimisticData, successData, failureData ...
    
        const parameters = {
    -       assigneeEmail,
    +       assigneeEmail: normalizedAssigneeEmail,
            limit,
            limitType,
            cardTitle,
            validateCode,
            domainAccountID,
        };
    
        // ... rest of the function
    }

    This ensures that phone numbers are converted to the proper SMS domain format (e.g., +15551234567@expensify.sms) before being sent to the backend, matching the format used when the member was invited to the workspace.

    What alternative solutions did you explore? (Optional)

    1. Fix at AssigneeStep level: Convert the phone number when setting invitingMemberEmail in AssigneeStep.tsx. However, this could cause issues with display (showing +15551234567@expensify.sms instead of the phone number) and with the invite flow that expects the raw phone number.

    2. Fix at InviteNewMemberStep level: Convert when setting assigneeEmail from invitingMemberEmail. This is a valid alternative but would require changes in multiple places if the same pattern exists elsewhere.

  6. 42 remaining items

  7. changed the title [-]Error when assigning Expensify card to phone number user invited during issue card flow[/-] [+][Due for payment 2026-08-17] Error when assigning Expensify card to phone number user invited during issue card flow[/+] on Aug 10, 2026
  8. melvin-bot commented on Aug 10, 2026

    @melvin-bot

    @parasharrajat / @daledah @mallenexpensify

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.51-1 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 2026-08-17. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  9. melvin-bot commented on Aug 13, 2026

    @melvin-bot

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

  10. melvin-bot commented on Aug 16, 2026

    @melvin-bot

    Current assignee @mallenexpensify is eligible for the Awaiting Payment assigner, not assigning anyone new.

  11. melvin-bot commented on Aug 16, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
  12. melvin-bot commented on Aug 17, 2026

    @melvin-bot

    @mallenexpensify Still overdue 6 days?! Let's take care of this!

  13. parasharrajat commented on Aug 18, 2026

    @parasharrajat
    Member

    BugZero Checklist:

    Regression Test Proposal

    Precondition:

    • Workspace is set up with Expensify card feature.

    Test:

    1. Go to staging.new.expensify.com
    2. Go to workspace settings > Expensify Card.
    3. Click Issue card.
    4. On cardholder step, enter a phone number (60128323983), select the phone number and click Invite.
    5. Complete the rest of the steps and reach confirm page.
    6. On confirm page, click Issue card.
    7. Enter magic code.
    8. Verify that: The card will be assigned successfully

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-9305-a38e-72ef-193a204dfc34
  14. mallenexpensify commented on Aug 18, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @daledah paid $250 via Upwork
    Contributor+: @parasharrajat due $250 via NewDot

  15. garrettmknight commented on Sep 18, 2026

    @garrettmknight
    Contributor

    $250 approved for @parasharrajat

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions