Skip to content

[Due for payment 2026-08-28] Travel - Existing user not displayed on Users page #92551

Closed

Description

@applause-bot

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: v9.3.98-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/folder/13177079/test-cases/104213728
Email or phone of affected tester (no customers): expensifail account
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Windows 11 / Chrome
App Component: Other

Action Performed:

Precondition: expensifail account with enabled Travel feature. Has at least 1 booked trip (e.g. flight) in the past.

  1. In NewDot, navigate to Workspace > Members
  2. Click the "Invite member" button and invite the secondary "New User" email (no Expensify account)
  3. Navigate to the Global Create (+) menu and select "Book Travel" > "Book Travel"
  4. Within the Expensify Travel interface( https://staging.travel.expensify.com/), navigate to Program > Users
  5. Repeat step 2 and invite existing Expensify user.

Expected Result:

The users invited in Step 2 and 5 is now listed in the Expensify Travel user list

Actual Result:

The user invited in Step 2 is listed in the Expensify Travel user list.
The user invited in Step 5 is not listed in the Expensify Travel user list.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7170633_1780500860296.bandicam_2026-06-03_18-18-06-107.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7170633

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. applause-bot commented on Jun 3, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/2ec193a085b364ebc32d8c2a29164fd75de9da8d3a75a084b78f480e7555eecb

  2. added
    Daily
    Bug
    on Jun 3, 2026
  3. MelvinBot commented on Jun 3, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    This is a backend/Travel-product issue, not an Expensify/App issue — it needs an internal engineer to investigate, not an open-source contributor.

    When you invite an existing Expensify user from inside the Expensify Travel interface (Program > Users at staging.travel.expensify.com), that invite and the "Users" list are rendered and managed entirely by the external Travel/Spotnana product and its backend. The App repo plays no part in that step, so the user not showing up in the list cannot be fixed in App.

    Why the two paths behave differently:

    • Step 2 (works): Inviting via Workspace > Members happens in App, which provisions the member through the workspace-members backend command. That path syncs the member into Travel.
    • Step 5 (broken): Inviting via the Travel interface happens entirely outside App. The sync of that invite back into the Travel "Users" list is handled by the backend Travel/Spotnana provisioning bridge — which is where the bug lives.

    The likely root cause is that an invite originating inside the Travel product for an already-existing Expensify account isn't being synced/deduplicated correctly on the backend, so it never appears in the Users list. Confirming this requires backend logs and access to the Travel/Spotnana provisioning bridge, which is outside this repo.

    Investigation details (App's role in Travel)

    App's only Travel responsibilities are (1) provisioning workspace members and (2) generating a Spotnana auth token then redirecting/webview-ing the user to the external Travel site:

    There is no App code that renders the Travel "Program > Users" page, handles the in-Travel invite action, or controls who appears in the Travel Users list. App only tracks Travel terms-acceptance / provisioning state in Onyx. So nothing in App can be changed to fix this symptom.

    Alternative explanations considered: A NewDot-side rendering or caching bug was ruled out — the broken step (5) never touches App; it occurs entirely within the external Travel interface.

    Next steps: This should be escalated to an internal engineer with access to the backend Travel/Spotnana provisioning bridge to investigate why an existing-user invite created from within the Travel interface doesn't sync to the Users list. There is no actionable App-repo fix here.


    Next Steps: Reply with @MelvinBot <your feedback> to refine this analysis.

  4. sandipanghos commented on Jun 3, 2026

    @sandipanghos

    Proposal

    What is the root cause of that problem?

    The bug lives in a single missing field in the API payload sent when workspace members are invited.

    File: src/libs/actions/Policy/Member.ts — lines 804–806 and 955

    When addMembersToWorkspace is called, invitedEmailsToAccountIDs contains every invited user's email → accountID mapping. The accountIDs array is extracted at line 805 but is only used to create optimistic personal-detail entries in Onyx — it is never included in the employees JSON sent to the backend:

    // Member.ts:804-806  ← accountIDs extracted here...
    const logins = Object.keys(invitedEmailsToAccountIDs)
        .map((l) => PhoneNumber.addSMSDomainIfPhoneNumber(l));
    const accountIDs = Object.values(invitedEmailsToAccountIDs);
    
    // Member.ts:955  ← ...but NEVER included in the payload
    employees: JSON.stringify(
        logins.map((login) => ({
            email: login,
            role,
            ...(approverEmail ? {submitsTo: approverEmail} : {}),
            // ← accountID is MISSING
        }))
    ),

    The backend provisions invited users in Spotnana. For brand-new users (no existing Expensify account), email-only is sufficient — there is no prior Spotnana persona to locate. For existing Expensify users, the backend must look up their Spotnana UUID via NVP_TRAVEL_SETTINGS.accountIDs (defined in src/types/onyx/TravelSettings.ts:4 as Record<string, string> — Spotnana UUIDs mapped to company IDs). Without accountID in the payload, the backend resolves by email alone — which fails or mismatches for users already provisioned under a different workspace's Spotnana company.

    New users are always created fresh → always appear in TravelDot.
    Existing users fail silently → never appear in TravelDot.

    This is exactly the behaviour described in the issue.


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

    File: src/libs/actions/Policy/Member.ts — line 955

    Add accountID to each employee entry. The data is already present in invitedEmailsToAccountIDs — no new fetching is needed.

    Before (line 955):

    employees: JSON.stringify(
        logins.map((login) => ({
            email: login,
            role,
            ...(approverEmail ? {submitsTo: approverEmail} : {}),
        }))
    ),

    After:

    employees: JSON.stringify(
        logins.map((login) => ({
            email: login,
            role,
            accountID: invitedEmailsToAccountIDs[login],   // ← add this one line
            ...(approverEmail ? {submitsTo: approverEmail} : {}),
        }))
    ),

    The backend now has the accountID it needs to look up the user's Spotnana UUID from NVP_TRAVEL_SETTINGS.accountIDs and add them to the correct Spotnana company — regardless of how many other Spotnana companies they were previously provisioned in.


    What alternative solutions did you explore? (Optional)

    openPolicyTravelPage (src/libs/actions/TravelInvoicing.ts:33–70) is already called every time the admin opens the Travel tab (PolicyTravelPage.tsx:54–56). Extending OpenPolicyTravelPageParams to include all current workspace members (emails + accountIDs) would let the backend sync every member with Spotnana on each visit — fixing this bug and preventing future drift.

    File: src/libs/actions/TravelInvoicing.ts — lines 65–69

    Before:

    const params: OpenPolicyTravelPageParams = { policyID };

    After:

    const params: OpenPolicyTravelPageParams = {
        policyID,
        employeeAccountIDs: JSON.stringify(
            Object.entries(policy?.employeeList ?? {})
                .map(([email, emp]) => ({ email, accountID: emp.accountID }))
        ),
    };

    This is safer as a belt-and-suspenders sync but requires more backend work than the primary fix. The accountID addition to ADD_MEMBERS_TO_WORKSPACE (primary fix) is more targeted and lower risk.


    Investigation Details

    Root Cause Code Path

    Step File Line What happens
    1 src/libs/actions/Policy/Member.ts 926 addMembersToWorkspace called with invitedEmailsToAccountIDs
    2 src/libs/actions/Policy/Member.ts 805 accountIDs = Object.values(invitedEmailsToAccountIDs) — data available
    3 src/libs/actions/Policy/Member.ts 955 employees JSON built without accountID
    4 src/libs/actions/Policy/Member.ts 966 API.write(ADD_MEMBERS_TO_WORKSPACE, params) — incomplete payload sent
    5 src/types/onyx/TravelSettings.ts 4 Backend needs accountID to look up accountIDs: Record<string, string>
    6 src/components/BookTravelButton.tsx 160–162 Only workspace-level provisioning checked — no user-level guard

    Why New Users Always Appear

    PersonalDetailsUtils.getNewAccountIDsAndLogins (line 207–218) returns only users whose allPersonalDetails[accountID] is empty — brand-new users with no prior Expensify account. For these users the backend creates a fresh Spotnana persona with no UUID lookup needed. They always appear.

    Why Existing Users Never Appear

    Existing users already have allPersonalDetails entries and a Spotnana UUID stored in NVP_TRAVEL_SETTINGS.accountIDs. Without accountID in the employees payload, the backend cannot distinguish which Spotnana company persona to link. The user is skipped silently.


    Edge Cases

    # Case Impact
    1 User already provisioned in a different workspace Spotnana company Backend email lookup matches wrong company — user still invisible (core bug scenario)
    2 User previously deleted from Spotnana — UUID tombstoned in NVP_TRAVEL_SETTINGS.accountIDs Stale UUID sent — user invisible even after fix without backend UUID validity check
    3 invitedEmailsToAccountIDs[login] is 0 for brand-new optimistic users accountID: 0 sent — backend must handle gracefully; should not treat as existing account
    4 User changes primary email after Spotnana provisioning Email lookup fails for new email; accountID fix resolves this since lookup is account-based
    5 Admin removes then re-invites same existing member Second ADD_MEMBERS_TO_WORKSPACE call triggers identical bug on re-invite

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  5. sandipanghos commented on Jun 3, 2026

    @sandipanghos

    Proposal

    [Updated](link to proposal)

  6. melvin-bot commented on Jun 8, 2026

    @melvin-bot

    Eep! 4 days overdue now. Issues have feelings too...

  7. sandipanghos commented on Jun 10, 2026

    @sandipanghos

    Proposal

    What is the root cause of that problem?

    The bug lives in a single missing field in the API payload sent when workspace members are invited.

    File: src/libs/actions/Policy/Member.ts — lines 804–806 and 955

    When addMembersToWorkspace is called, invitedEmailsToAccountIDs contains every invited user's email → accountID mapping. The accountIDs array is extracted at line 805 but is only used to create optimistic personal-detail entries in Onyx — it is never included in the employees JSON sent to the backend:

    // Member.ts:804-806  ← accountIDs extracted here...
    const logins = Object.keys(invitedEmailsToAccountIDs)
        .map((l) => PhoneNumber.addSMSDomainIfPhoneNumber(l));
    const accountIDs = Object.values(invitedEmailsToAccountIDs);
    
    // Member.ts:955  ← ...but NEVER included in the payload
    employees: JSON.stringify(
        logins.map((login) => ({
            email: login,
            role,
            ...(approverEmail ? {submitsTo: approverEmail} : {}),
            // ← accountID is MISSING
        }))
    ),

    The backend provisions invited users in Spotnana. For brand-new users (no existing Expensify account), email-only is sufficient — there is no prior Spotnana persona to locate. For existing Expensify users, the backend must look up their Spotnana UUID via NVP_TRAVEL_SETTINGS.accountIDs (defined in src/types/onyx/TravelSettings.ts:4 as Record<string, string> — Spotnana UUIDs mapped to company IDs). Without accountID in the payload, the backend resolves by email alone — which fails or mismatches for users already provisioned under a different workspace's Spotnana company.

    New users are always created fresh → always appear in TravelDot.
    Existing users fail silently → never appear in TravelDot.

    This is exactly the behaviour described in the issue.


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

    File: src/libs/actions/Policy/Member.ts — line 955

    Add accountID to each employee entry. The data is already present in invitedEmailsToAccountIDs — no new fetching is needed.

    Before (line 955):

    employees: JSON.stringify(
        logins.map((login) => ({
            email: login,
            role,
            ...(approverEmail ? {submitsTo: approverEmail} : {}),
        }))
    ),

    After:

    employees: JSON.stringify(
        logins.map((login) => ({
            email: login,
            role,
            accountID: invitedEmailsToAccountIDs[login],   // ← add this one line
            ...(approverEmail ? {submitsTo: approverEmail} : {}),
        }))
    ),

    The backend now has the accountID it needs to look up the user's Spotnana UUID from NVP_TRAVEL_SETTINGS.accountIDs and add them to the correct Spotnana company — regardless of how many other Spotnana companies they were previously provisioned in.


    What alternative solutions did you explore? (Optional)

    openPolicyTravelPage (src/libs/actions/TravelInvoicing.ts:33–70) is already called every time the admin opens the Travel tab (PolicyTravelPage.tsx:54–56). Extending OpenPolicyTravelPageParams to include all current workspace members (emails + accountIDs) would let the backend sync every member with Spotnana on each visit — fixing this bug and preventing future drift.

    File: src/libs/actions/TravelInvoicing.ts — lines 65–69

    Before:

    const params: OpenPolicyTravelPageParams = { policyID };

    After:

    const params: OpenPolicyTravelPageParams = {
        policyID,
        employeeAccountIDs: JSON.stringify(
            Object.entries(policy?.employeeList ?? {})
                .map(([email, emp]) => ({ email, accountID: emp.accountID }))
        ),
    };

    This is safer as a belt-and-suspenders sync but requires more backend work than the primary fix. The accountID addition to ADD_MEMBERS_TO_WORKSPACE (primary fix) is more targeted and lower risk.


    Investigation Details

    Root Cause Code Path

    Step File Line What happens
    1 src/libs/actions/Policy/Member.ts 926 addMembersToWorkspace called with invitedEmailsToAccountIDs
    2 src/libs/actions/Policy/Member.ts 805 accountIDs = Object.values(invitedEmailsToAccountIDs) — data available
    3 src/libs/actions/Policy/Member.ts 955 employees JSON built without accountID
    4 src/libs/actions/Policy/Member.ts 966 API.write(ADD_MEMBERS_TO_WORKSPACE, params) — incomplete payload sent
    5 src/types/onyx/TravelSettings.ts 4 Backend needs accountID to look up accountIDs: Record<string, string>
    6 src/components/BookTravelButton.tsx 160–162 Only workspace-level provisioning checked — no user-level guard

    Why New Users Always Appear

    PersonalDetailsUtils.getNewAccountIDsAndLogins (line 207–218) returns only users whose allPersonalDetails[accountID] is empty — brand-new users with no prior Expensify account. For these users the backend creates a fresh Spotnana persona with no UUID lookup needed. They always appear.

    Why Existing Users Never Appear

    Existing users already have allPersonalDetails entries and a Spotnana UUID stored in NVP_TRAVEL_SETTINGS.accountIDs. Without accountID in the employees payload, the backend cannot distinguish which Spotnana company persona to link. The user is skipped silently.


    Edge Cases

    # Case Impact
    1 User already provisioned in a different workspace Spotnana company Backend email lookup matches wrong company — user still invisible (core bug scenario)
    2 User previously deleted from Spotnana — UUID tombstoned in NVP_TRAVEL_SETTINGS.accountIDs Stale UUID sent — user invisible even after fix without backend UUID validity check
    3 invitedEmailsToAccountIDs[login] is 0 for brand-new optimistic users accountID: 0 sent — backend must handle gracefully; should not treat as existing account
    4 User changes primary email after Spotnana provisioning Email lookup fails for new email; accountID fix resolves this since lookup is account-based
    5 Admin removes then re-invites same existing member Second ADD_MEMBERS_TO_WORKSPACE call triggers identical bug on re-invite

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  8. melvin-bot commented on Jun 10, 2026

    @melvin-bot

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

  9. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  10. melvin-bot commented on Jun 16, 2026

    @melvin-bot

    12 days overdue now... This issue's end is nigh!

  11. melvin-bot commented on Jun 17, 2026

    @melvin-bot

    this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  12. 53 remaining items

  13. blimpich commented on Aug 28, 2026

    @blimpich
    Contributor

    My bad, thank you for the catch @situchan!

  14. added
    Awaiting Payment
    on Aug 31, 2026
  15. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. blimpich commented on Aug 31, 2026

    @blimpich
    Contributor

    @mallenexpensify @situchan is owed $250 for reviewing this PR

  17. melvin-bot commented on Aug 31, 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
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  18. moved this from Critical to Done in [#whatsnext] #Travelon Sep 1, 2026
  19. mallenexpensify commented on Sep 1, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @situchan due $250 via NewDot

    @situchan plz complete the Contributor+ checklist and tag me in a post once you have. Thx

  20. situchan commented on Sep 1, 2026

    @situchan
    Contributor

    BugZero Checklist:

    • [Contributor] 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:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/677634

    Regression Test Proposal

    Test:

    The modal is the same in every scenario below:

    • Title: Travel is not enabled
    • Message: To book, please enable travel on your default workspace or switch your default workspace to one that is travel-enabled.

    Precondition

    1. Sign in to https://staging.new.expensify.com with an account whose primary contact method is a private-domain email.
    2. Verify that the account is an admin on two paid workspaces, Collect or Control.
    3. Name one workspace "Travel WS" and enable Expensify Travel on it.
    4. Name the other workspace "No Travel WS" and leave travel disabled on it.
    5. Navigate to Settings > Workspaces.
    6. Open the three-dot menu on "No Travel WS" and click "Set as default workspace".

    Case 1: Travel quick action on Home

    1. Open the app in a wide browser window. The quick action row is hidden on narrow layouts.
    2. Navigate to Home.
    3. Click "Travel" in the quick action row above the widgets.
    4. Verify that the modal appears, and that Expensify Travel does not open.

    Case 2: Manage travel on the workspace travel page

    1. Navigate to Settings > Workspaces > "Travel WS" > Travel.
    2. Click "Manage travel".
    3. Verify that the modal appears, and that Expensify Travel does not open.

    Case 3: Book travel on the My trips page

    1. Open https://staging.new.expensify.com/travel?policyID=<policyID of Travel WS>.
    2. Click "Book travel".
    3. Verify that the modal appears, and that Expensify Travel does not open.

    Case 4: The modal is gone once the default workspace is travel-enabled

    1. Navigate to Settings > Workspaces.
    2. Open the three-dot menu on "Travel WS" and click "Set as default workspace".
    3. Repeat scenarios 1, 2 and 3.
    4. Verify that Expensify Travel opens every time, and that the modal never appears.

    Case 5: Enabling travel on a workspace is never blocked

    1. Set "No Travel WS" as the default workspace again.
    2. Open a third paid workspace that does not have travel enabled.
    3. Navigate to More features and toggle Travel on.
    4. Open the new Travel item in the left menu and click "Let's go".
    5. Verify that the travel setup flow opens as normal, and that the modal does not appear.

    Case 6: Paths that always book with the default workspace are unaffected

    1. Set "No Travel WS" as the default workspace.
    2. Open the green "+" button in the bottom bar.
    3. Verify that "Book travel" is not listed, because the default workspace has no travel.
    4. Set "Travel WS" as the default workspace.
    5. Open the green "+" button and click "Book travel".
    6. Verify that Expensify Travel opens, and that the modal does not appear.
    7. Navigate to Reports and run a search with the type "Trip" that returns no results.
    8. Click "Book a trip" in the empty state.
    9. Verify that Expensify Travel opens, and that the modal does not appear.

    I think some of the test steps will be deprecated in #99041

    Zapier Logs Run ID: 00040eee-de1e-a0a0-3b2a-180609e82794
  21. laurenreidexpensify commented on Sep 3, 2026

    @laurenreidexpensify
    Contributor

    $250 approved @situchan New Expensify

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

Metadata

Metadata

Labels

Awaiting PaymentBugDaily

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions