Skip to content

[Due for payment 2026-07-16] [$250] Email - Member invite with mention in room chat doesn't get the invite email #90141

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: v9.3.69-3
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/folder/13176726/test-cases/41237090
Email or phone of affected tester (no customers): lattelover1412+090511@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Win11/Chrome
App Component: Other

Action Performed:

  1. Go to staging.new.expensify.com

  2. Register as a new user to the app

  3. Select “Manage my team’s expenses” and click Continue

  4. Add a name for your business

  5. Fill out a first & last name

  6. Create a #room in the workspace

  7. Click on the header of the room and navigate to Members

  8. Click on the Invite button at the top

  9. Invite an email address that does not have an expensify account (Should be a real account with an inbox that can receive the invite)

  10. Open the Invitation mail box that was sent to the new user (step 9)

Expected Result:

After user invite email address that does not have an expensify account, a whisper message with option "invite to chat" displayed and invitation mail box should be sent then user able to proceed further steps.

Actual Result:

There is no whisper message "invite to chat" displayed and The member invited through the mentioned way doesn't get the invite email

Note: There is closed git #74788

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022053715853772050379
  • Upwork Job ID: 2053715853772050379
  • Last Price Increase: 2026-05-25
  • Automatic offers:
    • wildan-m | Contributor | 111765314
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 11, 2026
  2. MelvinBot commented on May 11, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause: This is a backend issue. The App client correctly sends the InviteToRoom API command with the non-Expensify email — no client-side filtering excludes external accounts. The system message (ROOM_CHANGE_LOG.INVITE_TO_ROOM) and the invite email are both created entirely server-side by the InviteToRoom backend command, which appears to be failing silently for non-Expensify email addresses.

    Note on the "invite to chat" whisper: The "invite to chat" whisper mentioned in the bug report is the ACTIONABLE_MENTION_WHISPER, which is a separate flow triggered by @mentioning a non-member in a message — it is not part of the Room > Members > Invite flow. The Room > Members > Invite flow should produce a ROOM_CHANGE_LOG.INVITE_TO_ROOM system message instead.

    Recommended Fix: Investigate the backend InviteToRoom command handler to determine why it is not creating the system message or sending the invite email for non-Expensify (unregistered) email addresses. The client sends {reportID, inviteeEmails, accountIDList} — for unknown users, accountIDList contains client-generated optimistic IDs that the server should ignore in favor of looking up or creating accounts by email.

    Investigation details

    Client-side flow (verified — working correctly)

    1. RoomInvitePage.tsx:191-214 — inviteUsers() builds an invitedEmailsToAccountIDs map. For unknown emails, accountID falls back to CONST.DEFAULT_NUMBER_ID (0) or an optimistic hash-based ID. For non-policy-expense-chat rooms, calls inviteToRoom().

    2. Report/index.ts:4878-4901 — inviteToRoom() calls buildInviteToRoomOnyxData() then sends WRITE_COMMANDS.INVITE_TO_ROOM with parameters {reportID, inviteeEmails, accountIDList}.

    3. Report/index.ts:4787-4791 — inviteeEmails contains ALL invited emails, but accountIDList is filtered via getNewAccountIDsAndLogins() to only include IDs for users not already in allPersonalDetails. For a single unknown email, both arrays align (length 1).

    4. RoomInvitePage.tsx:112-121 — Excluded users are only Expensify system emails and existing participants. Non-Expensify external emails are not filtered out.

    What the server should do

    When InviteToRoom receives a request with an unregistered email:

    1. Create/look up the account by email
    2. Add the account as a participant to the room
    3. Create a ROOM_CHANGE_LOG.INVITE_TO_ROOM report action (system message)
    4. Send an invite email to the unregistered address

    Steps 3 and 4 are not happening, indicating the backend command may be silently failing or skipping these steps for non-existent accounts.

    Alternative explanation considered

    Could the accountIDList mismatch cause the issue? For a single unknown email invite, inviteeEmails = ["email@example.com"] and accountIDList = ["<optimisticID>"] — both length 1, so no mismatch. The mismatch only occurs when mixing known + unknown users in one invite. This doesn't explain the bug for the single-user case described in the report.


    This appears to be a backend/internal issue. A separate internal investigation is needed into the InviteToRoom backend command to determine why it silently fails for unregistered email addresses.

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

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 11, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 11, 2026
  5. melvin-bot commented on May 11, 2026

    @melvin-bot

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

  6. wildan-m commented on May 11, 2026

    @wildan-m
    Contributor

    Proposal

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

    When a member is invited into a #room chat by mentioning their email in the chat (the email belongs to a person who does not yet have an Expensify account) and the inviter then clicks the "Invite to chat only" button on the resulting actionable mention whisper, the invited person is added to the room participants but never receives the welcome / invite email in their inbox. Inviting the same person from the room's Members page → Invite button sends the email correctly, so the two invite paths behave inconsistently. This is a regression that matches BrowserStack test case 41237090 and the previously closed #74788.

    What is the root cause of that problem?

    There are two server-side commands involved in inviting somebody to a room:

    • INVITE_TO_ROOM, used by the Members page → Invite flow, which is called with an explicit inviteeEmails array and an accountIDList describing who is being added. The backend uses this explicit invitee list to fan out the invite email to each new login.

    • RESOLVE_ACTIONABLE_MENTION_WHISPER, used when the inviter clicks "Invite to chat only" on the whisper produced by an unresolved mention. Look at how the frontend currently builds the parameters for this command:

    const parameters: ResolveActionableMentionWhisperParams = {
    reportActionID: reportAction.reportActionID,
    resolution,
    };
    API.write(WRITE_COMMANDS.RESOLVE_ACTIONABLE_MENTION_WHISPER, parameters, {optimisticData, failureData});

    Only reportActionID and resolution are sent. There is no reportID and no inviteeEmails in the request body. The parameter type itself only allows those two fields:

    type ResolveActionableMentionWhisperParams = {
    reportActionID: string;
    resolution: ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION> | ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_INVITE_TO_SUBMIT_EXPENSE_CONFIRM_WHISPER>;
    };

    As a result the backend has no explicit invitee data on this code path. It knows the whisper got resolved and it adds the mentioned users as participants of the room, but unlike INVITE_TO_ROOM it does not have the structured (reportID, inviteeEmails) pair it needs to enqueue the invite email job. The invited person therefore ends up inside the room without ever receiving the welcome / invite email — exactly the actual result reported in the issue.

    The data the backend needs is already sitting on the report action itself. The actionable mention whisper's originalMessage carries the unresolved invitee logins under the inviteeEmails field, declared here:

    /** Model of `actionable mention whisper` report action */
    type OriginalMessageActionableMentionWhisper = {
    /** Emails of users that aren't members of the room */
    inviteeEmails: string[];
    /** Account IDs of users that aren't members of the room */
    inviteeAccountIDs: number[];
    /** Decision on whether to invite users that were mentioned but aren't members or do nothing */
    resolution?: ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION> | null;
    /** Collection of accountIDs of users mentioned in message */
    whisperedTo?: number[];
    /** Timestamp of when the whisper was deleted (set by the backend when the parent comment is deleted) */
    deleted?: string | null;

    So the frontend has everything it needs to mirror the parameters that INVITE_TO_ROOM sends; it just is not forwarding them.

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

    Make the "Invite to chat only" path send the same identifying information that the Members page → Invite path sends, so the backend can trigger the invite email for the resolved whisper exactly the way it does for a direct Members page invite.

    Concretely:

    1. Extend the ResolveActionableMentionWhisperParams type to allow two additional optional fields: reportID and inviteeEmails: string[]. They are kept optional because the same command is also used for the "Do nothing" resolution and for the submit-expense confirm whisper, where invitee data is not needed.

    2. In resolveActionableMentionWhisper inside src/libs/actions/Report/index.ts, when the resolution is CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, read the originalMessage of the actionable mention whisper (the function already retrieves it for the optimistic participant update logic) and attach reportID plus originalMessage.inviteeEmails to the params object before calling API.write(WRITE_COMMANDS.RESOLVE_ACTIONABLE_MENTION_WHISPER, ...). For other resolutions (and for the confirm-whisper variant where the original message does not carry inviteeEmails) the new fields should be omitted, so behavior on those paths is unchanged.

    After this change, when "Invite to chat only" is clicked the backend receives the same (reportID, inviteeEmails) pair it already receives from the Members page invite, which is what it needs to send the welcome / invite email to each newly added login. The new fields are additive and optional, so existing call sites and backend handling for the non-invite resolutions are not affected.

    No string, navigation, or Onyx changes are needed; the optimistic participant update added by #88795 / #89363 already covers the in-app side of the flow, so this purely closes the email-sending half of the same fix.

    Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/90141-resolve-mention-invite-email?expand=1

    What alternative solutions did you explore? (Optional)

    Looking up the invitee data on the backend from the persisted report action keyed by reportActionID (so the frontend would not need to change). This would avoid touching the parameter type, but it pushes a frontend-known piece of data into a server-side lookup for no real benefit, increases coupling between the resolve command and the actionable whisper's storage layout, and is inconsistent with how the Members page invite already passes the same data explicitly. Forwarding the fields the frontend already has is the smaller, more symmetric change.

  7. KJ21-ENG commented on May 11, 2026

    @KJ21-ENG
    Contributor

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  8. changed the title [-]Email - Member invite with mention in room chat doesn't get the invite email[/-] [+][$250] Email - Member invite with mention in room chat doesn't get the invite email[/+] on May 11, 2026
  9. melvin-bot commented on May 11, 2026

    @melvin-bot
  10. github-actions commented on May 11, 2026

    @github-actions
    Contributor

    ⚠️ @KJ21-ENG Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  11. yusufdeveloper2903 commented on May 11, 2026

    @yusufdeveloper2903
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2026-06-18 16:54:51 UTC.

    Proposal

    What is the root cause of that problem?

    There are two parts to this bug, and the second (frontend) part is where the existing proposals fall short.

    1. The email suppression itself is a backend regression (already diagnosed in-thread). As confirmed by @amyevans / @mollfpr, the invite email stopped being sent because of Web-Expensify#52233 (deployed 4/24), which filtered system messages out of email notifications unless they are sandwiched between two regular messages. ACTION_INVITE_TO_ROOM got caught by that filter, so the welcome/invite email is suppressed entirely. This is being fixed server-side under E/E 642081 (the current HOLD).

    2. The remaining frontend gap is that the whisper-resolve command doesn't carry the invitee identity the backend needs — and it must do so for both invite resolutions, not just one.

    The Members → Invite path (inviteToRoom) sends the backend the full identity payload {reportID, inviteeEmails, accountIDList}, which is what lets the backend fan out the invite email:

    const parameters: InviteToRoomParams = {
    reportID: report.reportID,
    inviteeEmails,
    accountIDList: newAccountIDs.join(),
    };
    // eslint-disable-next-line rulesdir/no-multiple-api-calls
    API.write(WRITE_COMMANDS.INVITE_TO_ROOM, parameters, {optimisticData, successData, failureData});

    The whisper path (resolveActionableMentionWhisper) does not — it sends only reportActionID and resolution:

    const parameters: ResolveActionableMentionWhisperParams = {
    reportActionID: reportAction.reportActionID,
    resolution,
    };
    API.write(WRITE_COMMANDS.RESOLVE_ACTIONABLE_MENTION_WHISPER, parameters, {optimisticData, failureData});

    This is constrained by the param type, which only declares those two fields:

    type ResolveActionableMentionWhisperParams = {
    reportActionID: string;
    resolution: ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION> | ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_INVITE_TO_SUBMIT_EXPENSE_CONFIRM_WHISPER>;
    };

    So far this matches the existing proposals. The piece they miss: the MentionWhisperContent whisper exposes two invite options that both route through resolveActionableMentionWhisper and both invite a non-member — "Invite to submit expenses" (INVITE_TO_SUBMIT_EXPENSE) and "Invite to chat only" (INVITE):

    buttons.push({
    text: 'actionableMentionWhisperOptions.inviteToSubmitExpense',
    key: `${action.reportActionID}-actionableMentionWhisper-${CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE_TO_SUBMIT_EXPENSE}`,
    onPress: () =>
    resolveActionableMentionWhisper(
    actionOwnerReport,
    action,
    CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE_TO_SUBMIT_EXPENSE,
    isOriginalReportArchived,
    parentReport,
    ),
    });
    }
    buttons.push(
    {
    text: 'actionableMentionWhisperOptions.inviteToChat',
    key: `${action.reportActionID}-actionableMentionWhisper-${CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE}`,
    onPress: () => resolveActionableMentionWhisper(actionOwnerReport, action, CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, isOriginalReportArchived, parentReport),
    },
    {
    text: 'actionableMentionWhisperOptions.nothing',
    key: `${action.reportActionID}-actionableMentionWhisper-${CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.NOTHING}`,
    onPress: () => resolveActionableMentionWhisper(actionOwnerReport, action, CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.NOTHING, isOriginalReportArchived, parentReport),
    },

    The two resolution values are distinct constants:

    App/src/CONST/index.ts

    Lines 1835 to 1839 in d81cc58

    ACTIONABLE_MENTION_WHISPER_RESOLUTION: {
    INVITE: 'invited',
    INVITE_TO_SUBMIT_EXPENSE: 'inviteToSubmitExpense',
    NOTHING: 'nothing',
    },

    But the action's isInviteResolution flag — which gates the invite-specific behavior (optimistic participant add today, and the param forward the fix needs to add) — only matches INVITE:

    const isInviteResolution = resolution === CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE;
    const originalMessage = ReportActionsUtils.getOriginalMessage(reportAction as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_MENTION_WHISPER>);
    const inviteeAccountIDs = isInviteResolution ? (originalMessage?.inviteeAccountIDs ?? []) : [];
    const participantsInviteData = isInviteResolution && report ? buildParticipantsInviteData(report, inviteeAccountIDs) : undefined;

    This is exactly what @ikevin127 called out as the requirement: "ResolveActionableMentionWhisper (for both 'invite to submit expenses' OR 'invite for chat only' since these 2 should send the email)". A fix that forwards the identity only for resolution === INVITE (as the current proposals do) leaves the "Invite to submit expenses" whisper still emailless after the backend fix lands — the same root cause surviving in the sibling resolution.

    The data the backend needs is already on the report action and already retrieved one line above the gate — originalMessage.inviteeEmails:

    type OriginalMessageActionableMentionWhisper = {
    /** Emails of users that aren't members of the room */
    inviteeEmails: string[];
    /** Account IDs of users that aren't members of the room */
    inviteeAccountIDs: number[];

    So: BE filter suppresses the email (fixed under E/E 642081) → FE whisper-resolve never echoes (reportID, inviteeEmails) the way InviteToRoom does → and the one place that should echo it is gated to INVITE only, so even the partial FE fixes proposed so far would miss the INVITE_TO_SUBMIT_EXPENSE whisper.

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

    Make the whisper-resolve path forward the same identity payload InviteToRoom already sends, for both invite resolutions — reusing the data and the isInviteResolution flag already in scope.

    1. Broaden the existing isInviteResolution at Report/index.ts#L5700 to cover the submit-expense resolution too:
    const isInviteResolution =
        resolution === CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE ||
        resolution === CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE_TO_SUBMIT_EXPENSE;

    Because the optimistic participant logic at L5702-L5704 already keys off this same flag, this also makes the "Invite to submit expenses" path optimistically add the member to the room — matching the chat-only path's behavior added in #93856.

    1. Add two optional fields to ResolveActionableMentionWhisperParams (reportID?: string and inviteeEmails?: string[]). They stay optional because the same command is reused for the NOTHING resolution and the submit-expense confirm whisper, which carry no invitee data.

    2. In the params build at L5789, attach reportID and originalMessage.inviteeEmails (both already in scope — reportID from L5667, originalMessage from L5701) when isInviteResolution:

    const parameters: ResolveActionableMentionWhisperParams = {
        reportActionID: reportAction.reportActionID,
        resolution,
        ...(isInviteResolution ? {reportID, inviteeEmails: originalMessage?.inviteeEmails} : {}),
    };

    This makes the resolve request carry exactly the {reportID, inviteeEmails} payload @ikevin127 captured in the thread, mirroring InviteToRoom, for both invite buttons. Combined with the E/E 642081 backend fix, the invite email is then sent for both "Invite to chat only" and "Invite to submit expenses". The fields are additive/optional, so NOTHING and the confirm-whisper path are unchanged. Minor changes/improvements can be discussed in the PR phase.

    What alternative solutions did you explore? (Optional)

    Forward the identity only for resolution === INVITE (what the existing proposals do). Rejected: it leaves the "Invite to submit expenses" whisper still emailless, since that resolution flows through the same resolveActionableMentionWhisper command but never matches the narrow INVITE gate — directly contradicting the reviewer's stated requirement that both options send the email. Broadening the single isInviteResolution flag fixes both paths with one symmetric change and also brings the optimistic member-add to the submit-expense path for free.

  12. wildan-m commented on May 11, 2026

    @wildan-m
    Contributor

    Proposal updated — added compare branch with implementation.

  13. 61 remaining items

  14. ikevin127 commented on Jul 9, 2026

    @ikevin127
    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: N/A - Result of the original design

    • [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: N/A

    • [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/661245

    Regression Test Proposal

    1. Open a #room where you are an admin (e.g. a workspace room).
    2. In the room chat, @-mention an email address that does NOT have an Expensify account — use a +alias of your own Gmail so it has no Expensify account but still lands in your inbox (e.g. if your Gmail is youremail@gmail.com, use youremail+test@gmail.com) — and send the message.
    3. Verify the actionable whisper appears with the Invite to chat option, then click Invite to chat only.
    4. Verify the invited person is added to the room (an invited @<email> action appears).
    5. Wait ~10 minutes, then check the latest email in the invited address' inbox and verify the invitation email ("Here's what you missed … invited @…") arrived. Expensify can send this notification delayed — and only if the invitee hasn't already opened the room in the app — so it might not appear immediately; don't open the room as the invited user while waiting.

    Do we agree 👍 or 👎.

    Zapier Logs Run ID: 00040eee-8c9b-a6ce-63e8-5cf517b7a4d4
  15. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jul 9, 2026
  16. melvin-bot commented on Jul 15, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  17. mallenexpensify commented on Jul 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @wildan-m paid $250 via Upwork
    Contributor+: @ikevin127 due $250 via NewDot

    ^ Test case created. Thx

  18. quinthar commented on Jul 22, 2026

    @quinthar
    Contributor

    Approved $250 to @ikevin127

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