Skip to content

[Due for payment 2026-05-11] [$250] IOU Report - Members list fails to refresh after adding user from details page #88706

Closed

Description

@IuliiaHerets

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.62-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/folder/13177075/test-cases/41237841

Action Performed:

  1. Navigate to a 1:1 conversation
  2. Create some IOUs so there's a report with at least 2 items
  3. Navigate to the report conversation details
  4. Mention another user you have access to but that is not the other member of the conversation
  5. Verify a actionable whisper is displayed for the user to add the mentioned member to the conversation
  6. Click the avatar on the Concierge message
  7. Verify that the Concierge profile opens
  8. Click on the invite option
  9. Click on the header
  10. Click on members
  11. Verify the mentioned user is displayed in the members list of the conversation

Expected Result:

Verify the mentioned user is displayed in the members list of the conversation

Actual Result:

Not able to see the new member added in the list before refreshing the page

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

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

Screenshots/Videos

bandicam.2026-04-23.21-31-05-101.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022047731835075748501
  • Upwork Job ID: 2047731835075748501
  • Last Price Increase: 2026-04-24

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 24, 2026
  2. mukhrr commented on Apr 24, 2026

    @mukhrr
    Contributor

    cannot reproduce this

  3. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 24, 2026
  4. MelvinBot commented on Apr 24, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    resolveActionableMentionWhisper does not optimistically update report.participants in Onyx when the user clicks "Invite to chat" on the actionable whisper. The optimistic data only updates the report action's resolution message and the report's last message — it never adds the invited user to participants. Because the members list page reads participants directly from report.participants via Onyx, the new member doesn't appear until the server response arrives (or the user refreshes, triggering openReport).

    By contrast, the normal inviteToRoom flow correctly builds participantsAfterInvitation and includes it in optimistic data, so the UI updates immediately.

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

    In resolveActionableMentionWhisper, when the resolution is 'invited', extract inviteeAccountIDs from the report action's originalMessage and add an optimistic Onyx update for report.participants — mirroring what inviteToRoom does. Add the invited account IDs to report.participants with default notification preference and member role. Also add corresponding failure data to revert the participants on error.

    The same fix should also be applied to resolveActionableReportMentionWhisper which follows the same pattern and has the same gap.


    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.

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 24, 2026
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 24, 2026
  7. wildan-m commented on Apr 24, 2026

    @wildan-m
    Contributor

    Proposal

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

    In an IOU report conversation, when the "Invite to chat" option on the actionable mention whisper is clicked to add a mentioned user, the new member does not appear in the report's members list until the page is manually refreshed.

    What is the root cause of that problem?

    When the user clicks the "Invite to chat" button on an actionable mention whisper, the handler calls resolveActionableMentionWhisper with the INVITE resolution. That function only optimistically flips the whisper's resolution field on the report action; it does not optimistically merge the invitee into the chat's participants:

    function resolveActionableMentionWhisper(
    report: OnyxEntry<Report>,
    reportAction: OnyxEntry<ReportAction>,
    resolution: ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION> | ValueOf<typeof CONST.REPORT.ACTIONABLE_MENTION_INVITE_TO_SUBMIT_EXPENSE_CONFIRM_WHISPER>,
    isReportArchived: boolean | undefined,
    ) {
    const reportID = report?.reportID;
    if (!reportAction || !reportID) {
    return;
    }
    const message = ReportActionsUtils.getReportActionMessage(reportAction);
    if (!message) {
    return;
    }
    const updatedMessage: Message = {
    ...message,
    resolution,
    };
    const optimisticReportActions = {
    [reportAction.reportActionID]: {
    originalMessage: {
    resolution,
    },
    },
    };
    const reportUpdateDataWithPreviousLastMessage = getReportLastMessage(reportID, isReportArchived, optimisticReportActions as ReportActions);
    const reportUpdateDataWithCurrentLastMessage = {
    lastMessageText: report.lastMessageText,
    lastVisibleActionCreated: report.lastVisibleActionCreated,
    lastActorAccountID: report.lastActorAccountID,
    };
    const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS | typeof ONYXKEYS.COLLECTION.REPORT>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
    value: {
    [reportAction.reportActionID]: {
    message: [updatedMessage],
    originalMessage: {
    resolution,
    },
    },
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
    value: reportUpdateDataWithPreviousLastMessage,
    },
    ];
    const failureData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS | typeof ONYXKEYS.COLLECTION.REPORT>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
    value: {
    [reportAction.reportActionID]: {
    message: [message],
    originalMessage: {
    resolution: null,
    },
    },
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
    value: reportUpdateDataWithCurrentLastMessage, // revert back to the current report last message data in case of failure
    },
    ];
    const parameters: ResolveActionableMentionWhisperParams = {
    reportActionID: reportAction.reportActionID,
    resolution,
    };
    API.write(WRITE_COMMANDS.RESOLVE_ACTIONABLE_MENTION_WHISPER, parameters, {optimisticData, failureData});
    }

    The button in the whisper wires directly to this function without any other client-side invite call:

    buttons.push(
    {
    text: 'actionableMentionWhisperOptions.inviteToChat',
    key: `${action.reportActionID}-actionableMentionWhisper-${CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE}`,
    onPress: () => resolveActionableMentionWhisper(reportActionReport, action, CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, isOriginalReportArchived),
    },

    The server does add the invitee to the chat as part of processing RESOLVE_ACTIONABLE_MENTION_WHISPER, but the local report.participants collection is not updated optimistically. The members page reads its list from the locally cached report state through getReportPersonalDetailsParticipants, which is derived from report.participants:

    const {personalDetailsParticipants, participantsForDisplay} = getReportPersonalDetailsParticipants(report, personalDetails, reportMetadata);
    const participantsForDisplayMap = participantsForDisplay.reduce<Record<number, TupleToUnion<typeof participantsForDisplay>>>((acc, participant) => {
    acc[participant.accountID] = participant;
    return acc;
    }, {});
    const filterParticipants = (participant?: PersonalDetails) => {
    if (!participant) {
    return false;
    }
    return !!participantsForDisplayMap[participant.accountID] && !participantsForDisplayMap[participant.accountID].isPendingDelete;
    };
    const [selectedMembers, setSelectedMembers] = useFilteredSelection(personalDetailsParticipants, filterParticipants);
    // Get the active chat members by filtering out the pending members with delete action
    const activeParticipants = participantsForDisplay.filter((participant) => isOffline || !participant.isPendingDelete);

    Because this page only triggers a fresh server fetch via openRoomMembersPage for announcement rooms, a non-announcement chat (such as an IOU thread) shows stale participant data until a full page refresh triggers openReport and the server returns the updated membership. Compare this to inviteToRoom / buildInviteToRoomOnyxData, which is what the explicit invite screen uses and which does merge the new invitee into report.participants optimistically:

    const participantsAfterInvitation = inviteeAccountIDs.reduce(
    (reportParticipants: Participants, accountID: number) => {
    const participant: ReportParticipant = {
    notificationPreference: defaultNotificationPreference,
    role: CONST.REPORT.ROLE.MEMBER,
    };
    // eslint-disable-next-line no-param-reassign
    reportParticipants[accountID] = participant;
    return reportParticipants;
    },
    {...report.participants},
    );
    const newPersonalDetailsOnyxData = PersonalDetailsUtils.getPersonalDetailsOnyxDataForOptimisticUsers(newLogins, newAccountIDs, formatPhoneNumber);
    const pendingChatMembers = getPendingChatMembers(inviteeAccountIDs, reportMetadata?.pendingChatMembers ?? [], CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD);
    const newParticipantAccountCleanUp = newAccountIDs.reduce<Record<number, null>>((participantCleanUp, newAccountID) => {
    // eslint-disable-next-line no-param-reassign
    participantCleanUp[newAccountID] = null;
    return participantCleanUp;
    }, {});
    const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.REPORT | typeof ONYXKEYS.COLLECTION.REPORT_METADATA | typeof ONYXKEYS.PERSONAL_DETAILS_LIST>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
    value: {
    participants: participantsAfterInvitation,
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportID}`,
    value: {
    pendingChatMembers,
    },
    },
    ];

    The whisper-driven invite path is missing the equivalent optimistic participant merge, which is why the members list remains stale until a refresh.

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

    Extend resolveActionableMentionWhisper so that, when the resolution is CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, it also pushes an optimistic update that merges the whisper's invitees into the target report's participants map, mirroring what buildInviteToRoomOnyxData does for the explicit invite screen.

    Concretely, inside resolveActionableMentionWhisper:

    1. Read the whisper's inviteeAccountIDs (and inviteeEmails if needed for personal-detail plumbing) from the action's original message. These fields are already part of the OriginalMessageActionableMentionWhisper type.
    2. When resolution equals the INVITE constant, build a participants record keyed by each invitee accountID with {notificationPreference: getDefaultNotificationPreferenceForReport(report), role: CONST.REPORT.ROLE.MEMBER}, and append an optimistic Onyx MERGE update on ${ONYXKEYS.COLLECTION.REPORT}${reportID} that sets participants to this record. Since Onyx merges shallowly by key, existing participants stay intact.
    3. Add a matching failure-data entry that clears the newly added accountIDs (each set to null) so the optimistic membership is removed if the backend call fails, consistent with how pending chat membership errors are handled elsewhere.
    4. Skip this optimistic participant merge for the other resolutions (NOTHING, INVITE_TO_SUBMIT_EXPENSE), since those do not add the user to the conversation.

    No change is needed in MentionWhisperContent.tsx or in ReportParticipantsPage.tsx; the members list re-renders automatically when report.participants changes via Onyx.

    After this change, the members list reflects the newly invited user immediately when the whisper's "Invite to chat" option is used, and the pending state is rolled back automatically if the server call fails.

    Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/88706-mention-whisper-invite-participants?expand=1

    What alternative solutions did you explore? (Optional)

    Unconditionally calling openRoomMembersPage(report.reportID) on mount inside ReportParticipantsPage (not just for announcement rooms) would also surface the new member, because it would force a fresh server fetch every time the page opens. This was rejected because it treats the symptom rather than the root cause: it would add an extra API round-trip on every members page open even when local data is already correct, and would still show a brief stale flash before the request returned. Fixing the missing optimistic update at the source keeps the page instant and matches the pattern already used by the explicit invite screen.

  8. melvin-bot commented on Apr 24, 2026

    @melvin-bot

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

  9. melvin-bot commented on Apr 24, 2026

    @melvin-bot
  10. changed the title [-]IOU Report - Members list fails to refresh after adding user from details page[/-] [+][$250] IOU Report - Members list fails to refresh after adding user from details page[/+] on Apr 24, 2026
  11. 15antonian commented on Apr 24, 2026

    @15antonian

    Proposal

    What is the root cause of that problem?

    When "Invite to chat" is tapped on an actionable mention whisper, the handler calls resolveActionableMentionWhisper with resolution INVITE. That function builds optimistic Onyx data for the report action and the report's last-message fields, but its optimisticData array has no entry for ONYXKEYS.COLLECTION.REPORT_METADATA.

    The normal invite path — buildInviteToRoomOnyxData — does two things the whisper path skips. First, it adds the invitee to report.participants so the member list re-renders immediately. Second, and this is the gap the other proposals miss, it calls getPendingChatMembers and merges the result into REPORT_METADATA.pendingChatMembers with pendingAction: ADD. getReportPersonalDetailsParticipants reads pendingChatMember.pendingAction from REPORT_METADATA to decide whether to show a loading state and whether to mark the row as disabled during the pending window.

    // buildInviteToRoomOnyxData (line 4663) — whisper path has no equivalent:
    const pendingChatMembers = getPendingChatMembers(
        inviteeAccountIDs,
        reportMetadata?.pendingChatMembers ?? [],
        CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
    );

    Because resolveActionableMentionWhisper never sets pendingChatMembers, the invite has two observable failures: the member does not appear in the list until the server responds (the primary bug), and if the API call fails, the UI rolls back report.participants silently with no error indicator — the failureData in buildInviteToRoomOnyxData normally attaches getMicroSecondOnyxErrorWithTranslationKey('roomMembersPage.error.genericAdd') to each pending member entry, but the whisper path has no matching failure entry in REPORT_METADATA at all.

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

    In resolveActionableMentionWhisper, when resolution equals CONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, use ReportActionsUtils.isActionableMentionWhisper to narrow the action type, then read inviteeAccountIDs from the action's original message. With those IDs:

    1. Add an optimistic Onyx MERGE for ONYXKEYS.COLLECTION.REPORT that sets participants by reducing over the invitee IDs with notificationPreference: getDefaultNotificationPreferenceForReport(report) and role: CONST.REPORT.ROLE.MEMBER, spread over the existing participants map — matching the participantsAfterInvitation pattern in buildInviteToRoomOnyxData.
    2. Add an optimistic Onyx MERGE for ONYXKEYS.COLLECTION.REPORT_METADATA that sets pendingChatMembers via getPendingChatMembers(inviteeAccountIDs, reportMetadata?.pendingChatMembers ?? [], CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD). This gives the member list its loading state during the request.
    3. Add a successData entry that restores pendingChatMembers to the pre-invite value (filtering out the ADD entries that completed), matching buildInviteToRoomOnyxData's successPendingChatMembers cleanup.
    4. Add a failureData entry for REPORT_METADATA that maps each pending member entry to include getMicroSecondOnyxErrorWithTranslationKey('roomMembersPage.error.genericAdd') so the error brick-road indicator appears if the API call fails.

    No changes are needed in MentionWhisperContent.tsx or ReportParticipantsPage.tsx. Both re-render automatically from Onyx.

    Compare branch: https://github.com/Expensify/App/compare/main...15antonian:App:fix/88706-pendingChatMembers-whisper-invite?expand=1

    What alternative solutions did you explore? (Optional)

    Option: add an optimistic report.participants update only, without touching REPORT_METADATA. Rejected because: the member list would appear instantly but with no loading state and no error feedback on API failure. The pendingChatMember.pendingAction field read at ReportUtils.ts:12919 would always be undefined, leaving the row fully interactive even while the request is in flight — inconsistent with every other invite path in the app.

    Option: call openRoomMembersPage on mount in ReportParticipantsPage unconditionally instead of only for announcement rooms (line 128-134). Rejected because: this treats the symptom by forcing a server round-trip on every member page open, even when local data is already correct, and would still flash the stale state for the duration of the request.

    Option: extend resolveActionableReportMentionWhisper with the same fix. Rejected because: OriginalMessageActionableReportMentionWhisper has no inviteeAccountIDs field — that function handles report-level mentions, not user invites, and does not add anyone to the chat.

  12. emkhalid commented on Apr 24, 2026

    @emkhalid
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #88795 (already merged) added an optimistic participants merge in resolveActionableMentionWhisper covering the report owning the whisper (report), and an immediate parent passed in via the new parentReport argument. That fixes the case where the user mentions in the IOU report itself, but it does not cover the follow-up case (mention in a transaction thread → IOU's Members list stays stale until refresh).

    In MentionWhisperContent, parentReport is wired as originalReport ? report : undefined. When the user opens an expense's transaction-thread and mentions there, report and originalReport both equal the transaction thread, so parentReport ends up equal to report. Inside resolveActionableMentionWhisper, the parent merge is gated on parentReport.reportID !== reportID, which is false in this case, so the parent merge is skipped:

    src/libs/actions/Report/index.ts

    const parentInviteData = isInviteResolution && parentReport?.reportID && parentReport.reportID !== reportID ? buildParticipantsInviteData(parentReport, inviteeAccountIDs) : undefined;
    const parentParticipantsOptimisticData = parentInviteData?.optimistic;
    const parentParticipantsFailureData = parentInviteData?.failure;
    const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS | typeof ONYXKEYS.COLLECTION.REPORT>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
    value: {
    [reportAction.reportActionID]: {
    message: [updatedMessage],
    originalMessage: {
    resolution,
    },
    },
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
    value: {
    ...reportUpdateDataWithPreviousLastMessage,
    ...participantsOptimisticData,
    },
    },
    ];
    if (parentParticipantsOptimisticData && parentReport?.reportID) {
    optimisticData.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${parentReport.reportID}`,
    value: parentParticipantsOptimisticData,
    });
    }

    The result is that only the transaction-thread's participants map gets the optimistic merge. The IOU report (the transaction-thread's parent via parentReportID) is never updated, so its Members list reads a stale participants map and the new account ID doesn't appear until the server response arrives.

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

    Walk up the parent chain from report.parentReportID and apply the existing buildParticipantsInviteData helper to any money-request / invoice / policy-expense ancestor. Stop at the first non-money ancestor (e.g. the underlying chat) so unrelated reports are not touched. The walk also skips report and any parentReport already covered by the merged PR's existing parent merge, avoiding double-writes.

    src/libs/actions/Report/index.ts

    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;
    const participantsOptimisticData = participantsInviteData?.optimistic;
    const participantsFailureData = participantsInviteData?.failure;
    // When the action belongs to a child report (e.g. a one-transaction thread), also update
    // the parent report's participants so the members list the user is viewing updates immediately.
    const parentInviteData = isInviteResolution && parentReport?.reportID && parentReport.reportID !== reportID ? buildParticipantsInviteData(parentReport, inviteeAccountIDs) : undefined;
    const parentParticipantsOptimisticData = parentInviteData?.optimistic;
    const parentParticipantsFailureData = parentInviteData?.failure;
    const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS | typeof ONYXKEYS.COLLECTION.REPORT>> = [
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
    value: {
    [reportAction.reportActionID]: {
    message: [updatedMessage],
    originalMessage: {
    resolution,
    },
    },
    },
    },
    {
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
    value: {
    ...reportUpdateDataWithPreviousLastMessage,
    ...participantsOptimisticData,
    },
    },
    ];
    if (parentParticipantsOptimisticData && parentReport?.reportID) {
    optimisticData.push({
    onyxMethod: Onyx.METHOD.MERGE,
    key: `${ONYXKEYS.COLLECTION.REPORT}${parentReport.reportID}`,
    value: parentParticipantsOptimisticData,
    });
    }

     import {
         ...
         getDefaultNotificationPreferenceForReport,
         ...
    +    isInvoiceReport,
    +    isMoneyRequestReport,
    +    isPolicyExpenseChat,
         ...
     } from '@libs/ReportUtils';
     ...
         const parentInviteData = isInviteResolution && parentReport?.reportID && parentReport.reportID !== reportID ? buildParticipantsInviteData(parentReport, inviteeAccountIDs) : undefined;
         const parentParticipantsOptimisticData = parentInviteData?.optimistic;
         const parentParticipantsFailureData = parentInviteData?.failure;
    
    +    // The merged PR's `parentReport` only fires when `originalReport !== report`, which doesn't
    +    // help when the user views the whisper's report directly (e.g. opens a transaction thread
    +    // and mentions there — `originalReport === report`, parent merge is skipped). Walk up the
    +    // parent chain to cover money-request / invoice / policy-expense ancestors that the server
    +    // also updates. Stop at the first non-money ancestor (regular chats / DMs) so unrelated
    +    // reports are not touched.
    +    const ancestorMoneyReportInvites: Array<{id: string; data: NonNullable<ReturnType<typeof buildParticipantsInviteData>>}> = [];
    +    if (isInviteResolution) {
    +        const visited = new Set<string>([reportID, ...(parentReport?.reportID ? [parentReport.reportID] : [])]);
    +        let cursorID: string | undefined = report?.parentReportID;
    +        while (cursorID && !visited.has(cursorID)) {
    +            visited.add(cursorID);
    +            const ancestor = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${cursorID}`];
    +            if (!ancestor) {
    +                break;
    +            }
    +            if (!isMoneyRequestReport(ancestor) && !isInvoiceReport(ancestor) && !isPolicyExpenseChat(ancestor)) {
    +                break;
    +            }
    +            const data = buildParticipantsInviteData(ancestor, inviteeAccountIDs);
    +            if (data) {
    +                ancestorMoneyReportInvites.push({id: cursorID, data});
    +            }
    +            cursorID = ancestor.parentReportID;
    +        }
    +    }
    +
         const optimisticData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS | typeof ONYXKEYS.COLLECTION.REPORT>> = [
             ...
         ];
    
         if (parentParticipantsOptimisticData && parentReport?.reportID) {
             optimisticData.push({
                 onyxMethod: Onyx.METHOD.MERGE,
                 key: `${ONYXKEYS.COLLECTION.REPORT}${parentReport.reportID}`,
                 value: parentParticipantsOptimisticData,
             });
         }
    
    +    for (const {id, data} of ancestorMoneyReportInvites) {
    +        optimisticData.push({onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${id}`, value: data.optimistic});
    +    }
    +
         ...
    
         if (parentParticipantsFailureData && parentReport?.reportID) {
             failureData.push({
                 onyxMethod: Onyx.METHOD.MERGE,
                 key: `${ONYXKEYS.COLLECTION.REPORT}${parentReport.reportID}`,
                 value: parentParticipantsFailureData,
             });
         }
    
    +    for (const {id, data} of ancestorMoneyReportInvites) {
    +        failureData.push({onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${id}`, value: data.failure});
    +    }
    +
         API.write(WRITE_COMMANDS.RESOLVE_ACTIONABLE_MENTION_WHISPER, parameters, {optimisticData, failureData});

    What this does:

    1. After the merged PR's leaf and parent merges are computed, walk up report.parentReportID using the existing allReports collection (already in scope at the top of this file).
    2. For each ancestor that's a money-request / invoice / policy-expense report, build invite data via the merged PR's buildParticipantsInviteData helper. The helper already provides the skip-if-already-present guard (line 5409) and surgical rollback (line 5424), so an existing ancestor member is never overwritten and the rollback only nulls accounts the merge actually added.
    3. Stop the walk at the first non-money ancestor (regular chat / DM) — the server doesn't cascade the membership change there, so we shouldn't either.
    4. De-duplicate against report and parentReport so the merged PR's existing merges aren't doubled.
    5. Push each ancestor's optimistic write to optimisticData and the matching rollback to failureData. Behavior of the existing leaf and parent merges is unchanged.

    After this change, the IOU's Members list reflects the new invitee immediately for the follow-up repro path (mention in transaction thread → click Invite → open the IOU's Members), without waiting for the server response.

    What alternative solutions did you explore? (Optional)

    • Re-wire MentionWhisperContent so parentReport resolves the actual report.parentReportID instead of originalReport ? report : undefined. Rejected — that would change the semantics of the merged PR's existing parentReport argument across all callers and require coordinated changes in PureReportActionItem.tsx and MentionWhisperContent.tsx. Walking the chain inside resolveActionableMentionWhisper is single-file and reuses the existing helper.
    • Walk the chain unconditionally (no money-request type filter). Rejected — would write into regular chats / DMs above the IOU, where the server doesn't add the invitee. The optimistic state would diverge from server state.
    • Walk reverse-linked descendants (chatReportID === reportID reverse search) instead of parents. Rejected for this follow-up — the C+ confirmed the failing case is mention-in-transaction-thread, where the IOU is the parent, not a child. Reverse search would not find the IOU.
    • Force openReport(iouID) from the IOU's Members page on mount. Rejected — masks the symptom with a server round-trip on every Members open and still flashes stale state for the duration of the request.
  13. 45 remaining items

  14. melvin-bot commented on May 10, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  15. melvin-bot commented on May 11, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2047731835075748501/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  16. dukenv0307 commented on May 12, 2026

    @dukenv0307
    Contributor

    @Valforte what do you think about this?

  17. Valforte commented on May 13, 2026

    @Valforte
    Contributor

    I believe the issue was complex enough to warrant the bounty upgrade. I also agree on compensating @emkhalid for their help on the issue. @mallenexpensify can you handle the bounty changes?

  18. mallenexpensify commented on May 13, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @emkhalid paid $75 via Upwork
    Contributor+: @dukenv0307 due $500 via NewDot

    @emkhalid can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022047731835075748501

    ^ Test case created

  19. emkhalid commented on May 14, 2026

    @emkhalid
    Contributor

    @mallenexpensify I accepted the offer, thanks.

  20. mallenexpensify commented on May 15, 2026

    @mallenexpensify
    Contributor

    @emkhalid paid, summary updated above. Thx.

  21. quinthar commented on May 21, 2026

    @quinthar
    Contributor

    Approved $500 to @dukenv0307

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

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions