You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-05-11] [$250] IOU Report - Members list fails to refresh after adding user from details page #88706
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.
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.
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:
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:
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:
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.
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.
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.
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.
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.
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.
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
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:constpendingChatMembers=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:
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.
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.
Add a successData entry that restores pendingChatMembers to the pre-invite value (filtering out the ADD entries that completed), matching buildInviteToRoomOnyxData's successPendingChatMembers cleanup.
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.
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.
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:
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.
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:
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).
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.
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.
De-duplicate against report and parentReport so the merged PR's existing merges aren't doubled.
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.
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?
Activity
mukhrr commentedon Apr 24, 2026
cannot reproduce this
MelvinBot commentedon Apr 24, 2026
Proposal
What is the root cause of that problem?
resolveActionableMentionWhisperdoes not optimistically updatereport.participantsin 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 fromreport.participantsvia Onyx, the new member doesn't appear until the server response arrives (or the user refreshes, triggeringopenReport).By contrast, the normal
inviteToRoomflow correctly buildsparticipantsAfterInvitationand 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', extractinviteeAccountIDsfrom the report action'soriginalMessageand add an optimistic Onyx update forreport.participants— mirroring whatinviteToRoomdoes. Add the invited account IDs toreport.participantswith 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
resolveActionableReportMentionWhisperwhich follows the same pattern and has the same gap.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.wildan-m commentedon Apr 24, 2026
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
resolveActionableMentionWhisperwith theINVITEresolution. That function only optimistically flips the whisper'sresolutionfield on the report action; it does not optimistically merge the invitee into the chat'sparticipants:App/src/libs/actions/Report/index.ts
Lines 5354 to 5437 in 620eeaa
The button in the whisper wires directly to this function without any other client-side invite call:
App/src/pages/inbox/report/actionContents/MentionWhisperContent.tsx
Lines 50 to 55 in 620eeaa
The server does add the invitee to the chat as part of processing
RESOLVE_ACTIONABLE_MENTION_WHISPER, but the localreport.participantscollection is not updated optimistically. The members page reads its list from the locally cached report state throughgetReportPersonalDetailsParticipants, which is derived fromreport.participants:App/src/pages/ReportParticipantsPage.tsx
Lines 94 to 110 in 620eeaa
Because this page only triggers a fresh server fetch via
openRoomMembersPagefor announcement rooms, a non-announcement chat (such as an IOU thread) shows stale participant data until a full page refresh triggersopenReportand the server returns the updated membership. Compare this toinviteToRoom/buildInviteToRoomOnyxData, which is what the explicit invite screen uses and which does merge the new invitee intoreport.participantsoptimistically:App/src/libs/actions/Report/index.ts
Lines 4649 to 4686 in 620eeaa
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
resolveActionableMentionWhisperso that, when the resolution isCONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, it also pushes an optimistic update that merges the whisper's invitees into the target report'sparticipantsmap, mirroring whatbuildInviteToRoomOnyxDatadoes for the explicit invite screen.Concretely, inside
resolveActionableMentionWhisper:inviteeAccountIDs(andinviteeEmailsif needed for personal-detail plumbing) from the action's original message. These fields are already part of theOriginalMessageActionableMentionWhispertype.resolutionequals theINVITEconstant, 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 setsparticipantsto this record. Since Onyx merges shallowly by key, existing participants stay intact.null) so the optimistic membership is removed if the backend call fails, consistent with how pending chat membership errors are handled elsewhere.NOTHING,INVITE_TO_SUBMIT_EXPENSE), since those do not add the user to the conversation.No change is needed in
MentionWhisperContent.tsxor inReportParticipantsPage.tsx; the members list re-renders automatically whenreport.participantschanges 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 insideReportParticipantsPage(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.melvin-bot commentedon Apr 24, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (
External)melvin-bot commentedon Apr 24, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022047731835075748501
[-]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[/+]15antonian commentedon Apr 24, 2026
Proposal
What is the root cause of that problem?
When "Invite to chat" is tapped on an actionable mention whisper, the handler calls
resolveActionableMentionWhisperwith resolutionINVITE. That function builds optimistic Onyx data for the report action and the report's last-message fields, but itsoptimisticDataarray has no entry forONYXKEYS.COLLECTION.REPORT_METADATA.The normal invite path —
buildInviteToRoomOnyxData— does two things the whisper path skips. First, it adds the invitee toreport.participantsso the member list re-renders immediately. Second, and this is the gap the other proposals miss, it callsgetPendingChatMembersand merges the result intoREPORT_METADATA.pendingChatMemberswithpendingAction: ADD.getReportPersonalDetailsParticipantsreadspendingChatMember.pendingActionfromREPORT_METADATAto decide whether to show a loading state and whether to mark the row as disabled during the pending window.Because
resolveActionableMentionWhispernever setspendingChatMembers, 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 backreport.participantssilently with no error indicator — thefailureDatainbuildInviteToRoomOnyxDatanormally attachesgetMicroSecondOnyxErrorWithTranslationKey('roomMembersPage.error.genericAdd')to each pending member entry, but the whisper path has no matching failure entry inREPORT_METADATAat all.What changes do you think we should make in order to solve the problem?
In
resolveActionableMentionWhisper, whenresolutionequalsCONST.REPORT.ACTIONABLE_MENTION_WHISPER_RESOLUTION.INVITE, useReportActionsUtils.isActionableMentionWhisperto narrow the action type, then readinviteeAccountIDsfrom the action's original message. With those IDs:ONYXKEYS.COLLECTION.REPORTthat setsparticipantsby reducing over the invitee IDs withnotificationPreference: getDefaultNotificationPreferenceForReport(report)androle: CONST.REPORT.ROLE.MEMBER, spread over the existing participants map — matching theparticipantsAfterInvitationpattern inbuildInviteToRoomOnyxData.ONYXKEYS.COLLECTION.REPORT_METADATAthat setspendingChatMembersviagetPendingChatMembers(inviteeAccountIDs, reportMetadata?.pendingChatMembers ?? [], CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD). This gives the member list its loading state during the request.successDataentry that restorespendingChatMembersto the pre-invite value (filtering out the ADD entries that completed), matchingbuildInviteToRoomOnyxData'ssuccessPendingChatMemberscleanup.failureDataentry forREPORT_METADATAthat maps each pending member entry to includegetMicroSecondOnyxErrorWithTranslationKey('roomMembersPage.error.genericAdd')so the error brick-road indicator appears if the API call fails.No changes are needed in
MentionWhisperContent.tsxorReportParticipantsPage.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.participantsupdate only, without touchingREPORT_METADATA. Rejected because: the member list would appear instantly but with no loading state and no error feedback on API failure. ThependingChatMember.pendingActionfield 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
openRoomMembersPageon mount inReportParticipantsPageunconditionally 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
resolveActionableReportMentionWhisperwith the same fix. Rejected because:OriginalMessageActionableReportMentionWhisperhas noinviteeAccountIDsfield — that function handles report-level mentions, not user invites, and does not add anyone to the chat.emkhalid commentedon Apr 24, 2026
Proposal
What is the root cause of that problem?
PR #88795 (already merged) added an optimistic participants merge in
resolveActionableMentionWhispercovering the report owning the whisper (report), and an immediate parent passed in via the newparentReportargument. 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,parentReportis wired asoriginalReport ? report : undefined. When the user opens an expense's transaction-thread and mentions there,reportandoriginalReportboth equal the transaction thread, soparentReportends up equal toreport. InsideresolveActionableMentionWhisper, the parent merge is gated onparentReport.reportID !== reportID, which is false in this case, so the parent merge is skipped:src/libs/actions/Report/index.tsApp/src/libs/actions/Report/index.ts
Lines 5485 to 5518 in b77d56b
The result is that only the transaction-thread's
participantsmap gets the optimistic merge. The IOU report (the transaction-thread's parent viaparentReportID) is never updated, so its Members list reads a staleparticipantsmap 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.parentReportIDand apply the existingbuildParticipantsInviteDatahelper 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 skipsreportand anyparentReportalready covered by the merged PR's existing parent merge, avoiding double-writes.src/libs/actions/Report/index.tsApp/src/libs/actions/Report/index.ts
Lines 5475 to 5518 in b77d56b
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:
report.parentReportIDusing the existingallReportscollection (already in scope at the top of this file).buildParticipantsInviteDatahelper. 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.reportandparentReportso the merged PR's existing merges aren't doubled.optimisticDataand the matching rollback tofailureData. 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)
MentionWhisperContentsoparentReportresolves the actualreport.parentReportIDinstead oforiginalReport ? report : undefined. Rejected — that would change the semantics of the merged PR's existingparentReportargument across all callers and require coordinated changes inPureReportActionItem.tsxandMentionWhisperContent.tsx. Walking the chain insideresolveActionableMentionWhisperis single-file and reuses the existing helper.chatReportID === reportIDreverse 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.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.45 remaining items
melvin-bot commentedon May 10, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 11, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
dukenv0307 commentedon May 12, 2026
@Valforte what do you think about this?
Valforte commentedon May 13, 2026
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?
mallenexpensify commentedon May 13, 2026
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
emkhalid commentedon May 14, 2026
@mallenexpensify I accepted the offer, thanks.
mallenexpensify commentedon May 15, 2026
@emkhalid paid, summary updated above. Thx.
quinthar commentedon May 21, 2026
Approved $500 to @dukenv0307