Skip to content

iOS - Expense - App crashes when inviting a non existing user to an expense report #88058

Closed

Description

@mitarachim

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.60-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: #82065
Email or phone of affected tester (no customers): htad26+hehrhthf@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Critical User Impact
Device used: iOS 26.3 / iPhone 13
App Component: Money Requests

Action Performed:

  1. Launch the hybrid app
  2. Create an expense in a workspace chat
  3. Open the report.
  4. Click on the report header > Members.
  5. Click Invite members
  6. Invite a user who doesn't have an expensify account

Expected Result:

The user is invited without any issues

Actual Result:

The app crashes

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7131093_1776314031758!log.txt

Bug7131093_1776314031758.video_2026-04-16_07-32-56.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    DeployBlocker
    on Apr 16, 2026
  2. github-actions commented on Apr 16, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  3. OSBotify commented on Apr 16, 2026

    @OSBotify
    Contributor

    Investigation Summary: Classification: Frontend bug. Causing PR: #82065 - feat show Invite button on Members page for money request reports by @M00rish (High confidence). Recommendation: REVERT. PR #82065 added the Invite button to money request reports, but InviteReportParticipantsPage was built for group chats and does not handle the money request report context correctly, causing a crash on iOS when inviting a user without an Expensify account. Assigned: @M00rish (PR author), @abzokhattab (approving reviewer), @lakchote (approving reviewer). Labels: DeployBlockerCash kept. DeployBlocker removed. Root cause: In inviteUsers(), the check !accountID is true for accountID=0 (new user with no account), so they get skipped and an empty invitedEmailsToAccountIDs map is passed to inviteToGroupChat. Combined with isGroupChatReportUtils(report) returning false for a money request report, this issues an INVITE_TO_ROOM command for an unsupported report type causing the iOS native crash.

  4. removed
    DeployBlocker
    on Apr 16, 2026
  5. MelvinBot commented on Apr 16, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #82065 added an "Invite" button to the Members page for money request reports (IOU/expense reports) by changing the condition at ReportParticipantsPage.tsx:89:

    const shouldShowInviteButton = isGroupChat || isMoneyRequestReport(report);
    

    This navigates to InviteReportParticipantsPage, which calls inviteToGroupChat → inviteToRoom. Since a money request report is not a group chat, this falls through to WRITE_COMMANDS.INVITE_TO_ROOM — an API command not designed for expense/IOU reports. The server likely rejects or mishandles this, and the resulting failure data combined with the optimistic Onyx updates (adding participants with MEMBER role to an expense report) corrupts the report state, causing the iOS crash.

    This is compounded by a known iOS-specific FlashList crash pattern: the optimistic Onyx updates are applied synchronously before goBack() triggers a navigation transition, and the invite page's FlashList receives new data while its container is being hidden — a pattern that has caused crashes in similar flows (#81168, #78097).

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

    The invite button should not be shown for money request reports since the invite flow (INVITE_TO_ROOM / INVITE_TO_GROUP_CHAT) does not support them. Revert the condition in ReportParticipantsPage.tsx:89 back to:

    const shouldShowInviteButton = isGroupChat;
    

    If inviting members to expense reports is intended as a feature, a separate invite action supporting money request reports needs to be built with the appropriate API command and optimistic data handling.

    What alternative solutions did you explore? (Optional)

    An alternative would be to add a new code path in InviteReportParticipantsPage and inviteToRoom that handles money request reports differently (e.g., a new INVITE_TO_EXPENSE_REPORT API command). However, this is a larger change and the immediate fix should remove the unsupported UI to unblock the deploy.

    Supporting evidence

    Key code references:

    Related issues (same iOS FlashList/invite crash pattern):


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  6. removed
    DeployBlockerCash
    on Apr 16, 2026
  7. lakchote commented on Apr 16, 2026

    @lakchote
    Contributor

    #82065 got reverted, closing it

    cc @M00rish

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

Metadata

Metadata

Labels

BugEngineeringHourly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions