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
[$250] Expense - Not here page opens after invited member leaves IOU report #88420
Version Number: 9.3.61-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#88053 Email or phone of affected tester (no customers):sdsodijnosdjoij@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
[User A] Submit two IOU expenses to User B.
[User A] Open the IOU report.
[User A] Mention User C and send the mention in the report.
[User A] Click Invite to chat only.
[User C] Open the invited report.
[User C] Click on the report header > Leave.
Expected Result:
User will be redirected to Concierge or last opened report.
Actual Result:
Not here page opens after invited member leaves IOU report.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
There's a race condition in leaveRoom() between three async mechanisms. When a user leaves an IOU report:
Optimistic phase: Sets reportID: null and statusNum: CLOSED on the report (Report/index.ts:4451-4454). ReportNotFoundGuard still considers the report to exist because isOptimisticDelete is true (statusNum === CLOSED).
Success phase (async): Uses Onyx.METHOD.SET to replace the entire report with just {reportName} (Report/index.ts:4480-4484). This wipes both reportID and statusNum, making both!!reportID and isOptimisticDelete false.
Pusher leaving status (async round-trip): broadcastUserIsLeavingRoom sends a Pusher event (Report/index.ts:4433), but REPORT_USER_IS_LEAVING_ROOM is only set to true in Onyx when the event round-trips back through the Pusher server (Report/index.ts:559). There is no local/optimistic Onyx update for the current user's own leaving status.
In ReportNotFoundGuard.tsx:51: reportExists = !!reportID || isOptimisticDelete || userLeavingStatus. If the API success response arrives before the Pusher round-trip completes, all three conditions are false → "Not here" page appears.
PR #88053 likely surfaces this more reliably because it changed MoneyRequestReportActionsList to self-subscribe to Onyx via stable reportIDFromRoute (from route params) instead of receiving reportID as a prop from the parent. Previously, when the report was cleared, the parent MoneyRequestReportView would bail at its early-return guard, preventing child re-renders. Now the child components remain subscribed and continue re-rendering during the race window, increasing the chance of hitting the timing gap.
What changes do you think we should make in order to solve the problem?
Set REPORT_USER_IS_LEAVING_ROOMoptimistically in Onyx directly inside leaveRoom(), rather than relying solely on the Pusher round-trip. Add an Onyx.merge call right before the API call in leaveRoom():
In src/libs/actions/Report/index.ts, inside leaveRoom(), add REPORT_USER_IS_LEAVING_ROOM to the optimistic data so that ReportNotFoundGuard always sees userLeavingStatus = true throughout the entire leaving flow, regardless of Pusher timing.
And the successData/failureData should handle cleanup appropriately (set to false on failure; on success, the existing unsubscribeFromLeavingRoomReportChannel cleanup should handle it).
This ensures the guard condition reportExists = !!reportID || isOptimisticDelete || userLeavingStatus always has at least one true value during the leave transition.
What alternative solutions did you explore? (Optional)
Navigate before API call: Move navigateToMostRecentReport() to fire synchronously before the API write. However, Navigation.goBack() is deferred via TransitionTracker.runAfterTransitions(), so this wouldn't fully solve the race.
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.
Hi @sobitneupane, I believe my PR #88804 (fixing #85943) may also resolve this issue, as both share the same root cause: after leaving an invited IOU report, the app navigates to the parent report without checking whether the current user is a participant, resulting in the "Not here" page.
The fix adds a participant check before navigating to the parent report, and falls back to Concierge if the user isn't a participant. Could you verify whether #88804 covers this case as well?
Activity
melvin-bot commentedon Apr 21, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #88053
melvin-bot commentedon Apr 21, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 21, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon Apr 21, 2026
Proposal
What is the root cause of that problem?
There's a race condition in
leaveRoom()between three async mechanisms. When a user leaves an IOU report:Optimistic phase: Sets
reportID: nullandstatusNum: CLOSEDon the report (Report/index.ts:4451-4454).ReportNotFoundGuardstill considers the report to exist becauseisOptimisticDeleteistrue(statusNum === CLOSED).Success phase (async): Uses
Onyx.METHOD.SETto replace the entire report with just{reportName}(Report/index.ts:4480-4484). This wipes bothreportIDandstatusNum, making both!!reportIDandisOptimisticDeletefalse.Pusher leaving status (async round-trip):
broadcastUserIsLeavingRoomsends a Pusher event (Report/index.ts:4433), butREPORT_USER_IS_LEAVING_ROOMis only set totruein Onyx when the event round-trips back through the Pusher server (Report/index.ts:559). There is no local/optimistic Onyx update for the current user's own leaving status.In
ReportNotFoundGuard.tsx:51:reportExists = !!reportID || isOptimisticDelete || userLeavingStatus. If the API success response arrives before the Pusher round-trip completes, all three conditions arefalse→ "Not here" page appears.PR #88053 likely surfaces this more reliably because it changed
MoneyRequestReportActionsListto self-subscribe to Onyx via stablereportIDFromRoute(from route params) instead of receivingreportIDas a prop from the parent. Previously, when the report was cleared, the parentMoneyRequestReportViewwould bail at its early-return guard, preventing child re-renders. Now the child components remain subscribed and continue re-rendering during the race window, increasing the chance of hitting the timing gap.What changes do you think we should make in order to solve the problem?
Set
REPORT_USER_IS_LEAVING_ROOMoptimistically in Onyx directly insideleaveRoom(), rather than relying solely on the Pusher round-trip. Add anOnyx.mergecall right before the API call inleaveRoom():In
src/libs/actions/Report/index.ts, insideleaveRoom(), addREPORT_USER_IS_LEAVING_ROOMto the optimistic data so thatReportNotFoundGuardalways seesuserLeavingStatus = truethroughout the entire leaving flow, regardless of Pusher timing.The optimisticData array should include:
And the successData/failureData should handle cleanup appropriately (set to
falseon failure; on success, the existingunsubscribeFromLeavingRoomReportChannelcleanup should handle it).This ensures the guard condition
reportExists = !!reportID || isOptimisticDelete || userLeavingStatusalways has at least onetruevalue during the leave transition.What alternative solutions did you explore? (Optional)
Navigate before API call: Move
navigateToMostRecentReport()to fire synchronously before the API write. However,Navigation.goBack()is deferred viaTransitionTracker.runAfterTransitions(), so this wouldn't fully solve the race.Keep
statusNum: CLOSEDin success data: Instead of wiping the report withOnyx.METHOD.SET, merge only the fields that need clearing while preservingstatusNum. This would keepisOptimisticDeletetrue, but conflicts with the existing fix for [Due for payment 2025-03-05] [$250] Room - Room mention turns into a random number after leaving a private room #55676 which specifically needsSETto avoid showing random numbers.Investigation details
Related issues:
Key code references:
ReportNotFoundGuard.tsx:47-54— The guard that determines "Not here" displayReport/index.ts:4419-4531—leaveRoom()functionReport/index.ts:4480-4484— Success data that wipes the report withOnyx.METHOD.SETReport/index.ts:2471-2477—broadcastUserIsLeavingRoom()sends Pusher event onlyReport/index.ts:544-559— Pusher subscription that setsREPORT_USER_IS_LEAVING_ROOMin Onyx (the only place it gets set totrue)ReportNavigateAwayHandler.tsx:137-158— Navigate-away logic that should redirect but may fire after the guard rendersEvidence chain:
leaveRoom()→ optimisticstatusNum=CLOSED(guard suppressed) → API successOnyx.SET({reportName})wipesstatusNum(guard no longer suppressed) → Pusher hasn't arrived yet (userLeavingStatus=false) →reportExists=false→ "Not here" pageNext 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.rlinoz commentedon Apr 21, 2026
@MelvinBot implement this
MelvinBot commentedon Apr 21, 2026
🤖 Draft PR created: #88433
Please mark it as "Ready for review" when it is ready for review.
22 remaining items
marufsharifi commentedon Apr 27, 2026
@sobitneupane, could you please give me your feedback on my proposals? thanks.
sobitneupane commentedon Apr 27, 2026
@marufsharifi I will be reviewing all proposals in the order they were submitted. I will update you once I reach yours.
melvin-bot commentedon Apr 27, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
neerajbachani commentedon Apr 27, 2026
Hi @sobitneupane, I believe my PR #88804 (fixing #85943) may also resolve this issue, as both share the same root cause: after leaving an invited IOU report, the app navigates to the parent report without checking whether the current user is a participant, resulting in the "Not here" page.
The fix adds a participant check before navigating to the parent report, and falls back to Concierge if the user isn't a participant. Could you verify whether #88804 covers this case as well?
sobitneupane commentedon Apr 28, 2026
@neerajbachani This looks like a duplicate of #85943 issue. I don't see any differences between the two.
@huult Could you please also ensure this issue is resolved on "MacOS: Chrome / Safari" as well? Thanks!
melvin-bot commentedon Apr 28, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
huult commentedon May 1, 2026
@sobitneupane yes
melvin-bot commentedon May 1, 2026
@sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick!
sobitneupane commentedon May 4, 2026
@rlinoz I believe we are good to close this issue. It will be handled in #85943
rlinoz commentedon May 4, 2026
Sounds good, thanks!