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] [Awaiting Payment] Expense - Not here page is displayed when a member deletes an expense #80893
Version Number: 9.3.11-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://github.com/Expensify/Expensify/issues/514747 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Windows 10 - Chrome App Component: Other
Action Performed:
Go to staging.new.expensify.com
As user A, create a workspace and add user B as a member.
As user B, go to the WS chat and create an expense.
As user A, go to the WS chat of user B and open the expense.
As user B, delete the expense.
Navigate back to the tab where you are logged in as user A
Expected Result:
user A is navigated back to the main chat.
Actual Result:
Not here page is displayed when the member deletes the expense
🚨 Edited by proposal-police: This proposal was edited at 2026-01-29 15:19:56 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When User A views an expense created by User B in a workspace chat, and User B deletes the expense while User A has it open, User A sees a "Not here" page instead of being redirected back to the workspace chat.
What is the root cause of that problem?
The issue is in ReportScreen.tsx. The shouldShowNotFoundPage calculation doesn't account for the reportWasDeleted state:
When an expense report is deleted by another user:
The useReportWasDeleted hook detects the deletion and sets reportWasDeleted to true
However, shouldShowNotFoundPage becomes true because reportExists is false (report was removed from Onyx)
The "Not here" page is shown immediately
There's a useEffect (lines 838-860) that should redirect when reportWasDeleted is true AND the screen is focused, but it cannot help because the "Not here" page is already rendered synchronously before the navigation effect can execute
The navigation effect exists and works correctly - it tries to navigate to the parent report (workspace chat) when a report is deleted. But the UI renders the "Not here" page before this effect can redirect the user.
What changes do you think we should make in order to solve the problem?
Modify the shouldShowNotFoundPage calculation to not show the "Not here" page when reportWasDeleted is true. This allows the navigation useEffect to properly redirect the user to the parent report (workspace chat) instead of showing a dead-end "Not here" page.
--- a/src/pages/inbox/ReportScreen.tsx+++ b/src/pages/inbox/ReportScreen.tsx@@ -526,6 +526,11 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
// eslint-disable-next-line rulesdir/no-negated-variables
const shouldShowNotFoundPage = useMemo((): boolean => {
+ // If the report was deleted, don't show the "Not here" page - let the navigation+ // effect handle redirection to the parent report+ if (reportWasDeleted) {+ return false;+ }+
const isInvalidReportPath = !!currentReportIDFormRoute && !isValidReportIDFromPath(currentReportIDFormRoute);
const isLoading = isLoadingApp !== false || isLoadingReportData || !!reportMetadata?.isLoadingInitialReportActions;
const reportExists = !!reportID || isOptimisticDelete || userLeavingStatus;
@@ -548,6 +553,7 @@ function ReportScreen({route, navigation}: ReportScreenProps) {
return !reportExists;
}, [
+ reportWasDeleted,
shouldShowNotFoundLinkedAction,
isLoadingApp,
isLoadingReportData,
This ensures that when a report is deleted:
reportWasDeleted becomes true
shouldShowNotFoundPage returns false (because of the new early return)
The navigation useEffect detects reportWasDeleted is true and redirects to the parent report (workspace chat)
Please re-state the problem that we are trying to solve in this issue.
When User A is viewing an expense report in a workspace chat and User B deletes that expense, User A is shown the "Not here" page instead of being redirected back to the workspace chat.
What is the root cause of that problem?
ReportScreen decides to render the Not Found view as soon as the report disappears from Onyx, but the shouldShowNotFoundPage calculation does not account for the reportWasDeleted state that is set by useReportWasDeleted.
When User B deletes the expense, reportID becomes undefined so reportExists is false and shouldShowNotFoundPage returns true, which renders the Not Found view immediately. The redirect logic that runs when reportWasDeleted is true is a later effect, so the UI briefly (and sometimes persistently) shows the "Not here" page before the navigation can take the user back to the parent report.
What changes do you think we should make in order to solve the problem?
Update shouldShowNotFoundPage to return false when reportWasDeleted is true, so we avoid rendering the Not Found view while the deletion redirect effect is about to navigate the user back to the parent report.
This keeps the Not Found view for true invalid routes and linked-action cases, but avoids showing it when the report was deleted and the redirect effect is expected to run.
What alternative solutions did you explore? (Optional)
I considered forcing navigation earlier (e.g., converting the deletion redirect to a layout effect), but suppressing the Not Found view when reportWasDeleted is true is the smallest change that aligns with the existing deletion flow.
⚠️@yatin-italy 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.
Please re-state the problem that we are trying to solve in this issue.
When a member deletes an expense, they are shown the "Not Here" page instead of being navigated back to a previous screen.
What is the root cause of that problem?
In this screen, we do not handle the case where the user no longer has access to the report. As a result, the UI defaults to showing the "Not Here" page. In contrast, we already handle this case correctly in the ReportScreen by navigating the user away when the report becomes inaccessible.
What changes do you think we should make in order to solve the problem?
We should add a useEffect hook to detect when the expense report is removed, similar to the logic used in ReportScreen. This will allow us to navigate the user back instead of displaying an error page. Below is a simplified version of the implementation:
function isEmpty(report: OnyxEntry<OnyxTypes.Report>): boolean {
if (isEmptyObject(report)) {
return true;
}
return !Object.values(report).some((value) => value !== undefined && value !== '');
}
const [firstRender, setFirstRender] = useState(true);
useEffect(() => {
if (firstRender) {
setFirstRender(false);
return;
}
const isRemovalExpectedForReportType = isEmpty(report) && isMoneyRequestReport(prevReport);
if (isRemovalExpectedForReportType) {
if (!isFocused) {
return;
}
Navigation.dismissModal();
}
}, [report]);
This effect ensures the user is redirected if the report is deleted or becomes unavailable, aligning behavior with other report screens.
What alternative solutions did you explore? (Optional)
None at this time, as reusing the pattern established in ReportScreen is the most consistent and reliable approach.
changed the title [-][Awaiting Payment] Expense - Not here page is displayed when a member deletes an expense[/-][+][$250] [Awaiting Payment] Expense - Not here page is displayed when a member deletes an expense[/+]on Mar 6, 2026
Summary: When User A is viewing an expense report (opened via SearchMoneyRequestReportPage) and User B deletes that expense, User A sees a "Not here" page instead of being navigated back.
Status: This issue already has an approved proposal from paulnjs (comment) and a merged fix in PR #81620.
Root Cause: The bug is in SearchMoneyRequestReportPage.tsx, not ReportScreen.tsx. The page has a shouldShowAccessErrorPage useMemo that evaluates to true during pending deletion states (isReportPendingDeletion, wereAllTransactionsDeleted, etc.), rendering FullPageNotFoundView immediately. While there is an existing dismissModal useEffect (lines 83-100) that handles full report removal from Onyx, it only fires when the report object becomes completely null — which happens after the pending deletion state triggers the "Not here" page. The timing gap between pending deletion (where the NotFound view renders) and full Onyx removal (where dismissModal fires) is what causes the bug.
Fix (already merged): The merged PR added a useEffect that detects when the report enters a deletion/removal state and calls Navigation.dismissModal() before the shouldShowAccessErrorPage can render the NotFound view, aligning with the pattern used in ReportScreen.tsx.
Detailed Investigation
Root Cause Analysis
The SearchMoneyRequestReportPage.tsx page has two competing mechanisms:
shouldShowAccessErrorPage (lines 327-358): A useMemo that returns true when isReportPendingDeletion, wereAllTransactionsDeleted, wasParentActionDeleted, or isThreadReportDeletedForReview is true. This triggers FullPageNotFoundView at line 404.
dismissModal useEffect (lines 83-100): Detects when report becomes null (full Onyx removal) while prevReport was a money request report, then calls Navigation.dismissModal().
The problem: When User B deletes an expense, the deletion goes through stages:
First, the report enters a pending deletion state (transactions get pendingAction=DELETE)
shouldShowAccessErrorPage fires immediately at this stage, showing the "Not here" page
Only later is the report fully removed from Onyx, which would trigger the dismissModal useEffect
The user sees the NotFound page in the window between these two events
In contrast, ReportScreen.tsx handles this correctly by using the useReportWasDeleted hook plus an inline isRemovalExpectedForReportType check that both navigate away before the NotFound view can render.
Evidence Chain
shouldShowAccessErrorPage at App/src/pages/Search/SearchMoneyRequestReportPage.tsx:327-358 → evaluates true during pending deletion
FullPageNotFoundView at App/src/pages/Search/SearchMoneyRequestReportPage.tsx:404-410 → renders "Not here" page
Existing dismissModal at App/src/pages/Search/SearchMoneyRequestReportPage.tsx:83-100 → only fires on full Onyx removal (too late)
ReportScreen.tsx comparison at App/src/pages/inbox/ReportScreen.tsx:701-768,798-820 → handles both pending deletion and full removal
Relevant Code
App/src/pages/Search/SearchMoneyRequestReportPage.tsx:83-100 - Existing dismissModal useEffect (insufficient for pending deletion)
App/src/pages/Search/SearchMoneyRequestReportPage.tsx:327-358 - shouldShowAccessErrorPage condition that triggers the bug
App/src/pages/inbox/ReportScreen.tsx:701-768 - ReportScreen's more comprehensive deletion handling (for comparison)
Note: This issue is already resolved — the approved proposal from paulnjs was implemented in PR #81620 (merged 2026-02-17). The issue is currently in Awaiting Payment status.
Activity
melvin-bot commentedon Jan 29, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @truph01 (
External)melvin-bot commentedon Jan 29, 2026
Triggered auto assignment to @bfitzexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.daledah commentedon Jan 29, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-01-29 15:19:56 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When User A views an expense created by User B in a workspace chat, and User B deletes the expense while User A has it open, User A sees a "Not here" page instead of being redirected back to the workspace chat.
What is the root cause of that problem?
The issue is in
ReportScreen.tsx. TheshouldShowNotFoundPagecalculation doesn't account for thereportWasDeletedstate:App/src/pages/inbox/ReportScreen.tsx
Lines 526 to 558 in eb7deee
When an expense report is deleted by another user:
useReportWasDeletedhook detects the deletion and setsreportWasDeletedtotrueshouldShowNotFoundPagebecomestruebecausereportExistsisfalse(report was removed from Onyx)useEffect(lines 838-860) that should redirect whenreportWasDeletedis true AND the screen is focused, but it cannot help because the "Not here" page is already rendered synchronously before the navigation effect can executeApp/src/pages/inbox/ReportScreen.tsx
Lines 838 to 860 in eb7deee
The navigation effect exists and works correctly - it tries to navigate to the parent report (workspace chat) when a report is deleted. But the UI renders the "Not here" page before this effect can redirect the user.
What changes do you think we should make in order to solve the problem?
Modify the
shouldShowNotFoundPagecalculation to not show the "Not here" page whenreportWasDeletedistrue. This allows the navigationuseEffectto properly redirect the user to the parent report (workspace chat) instead of showing a dead-end "Not here" page.This ensures that when a report is deleted:
reportWasDeletedbecomestrueshouldShowNotFoundPagereturnsfalse(because of the new early return)useEffectdetectsreportWasDeletedis true and redirects to the parent report (workspace chat)annaweber830 commentedon Jan 29, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When User A is viewing an expense report in a workspace chat and User B deletes that expense, User A is shown the "Not here" page instead of being redirected back to the workspace chat.
What is the root cause of that problem?
ReportScreendecides to render the Not Found view as soon as the report disappears from Onyx, but theshouldShowNotFoundPagecalculation does not account for thereportWasDeletedstate that is set byuseReportWasDeleted.App/src/pages/home/ReportScreen.tsx
Lines 525 to 557 in 87e6d66
When User B deletes the expense,
reportIDbecomes undefined soreportExistsis false andshouldShowNotFoundPagereturnstrue, which renders the Not Found view immediately. The redirect logic that runs whenreportWasDeletedistrueis a later effect, so the UI briefly (and sometimes persistently) shows the "Not here" page before the navigation can take the user back to the parent report.What changes do you think we should make in order to solve the problem?
Update
shouldShowNotFoundPageto returnfalsewhenreportWasDeletedistrue, so we avoid rendering the Not Found view while the deletion redirect effect is about to navigate the user back to the parent report.App/src/pages/home/ReportScreen.tsx
Lines 525 to 557 in 87e6d66
Current code:
Updated code:
This keeps the Not Found view for true invalid routes and linked-action cases, but avoids showing it when the report was deleted and the redirect effect is expected to run.
What alternative solutions did you explore? (Optional)
I considered forcing navigation earlier (e.g., converting the deletion redirect to a layout effect), but suppressing the Not Found view when
reportWasDeletedis true is the smallest change that aligns with the existing deletion flow.yatin-italy commentedon Jan 30, 2026
🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.
github-actions commentedon Jan 30, 2026
paulnjs commentedon Jan 30, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
useEffecthook to detect when the expense report is removed, similar to the logic used inReportScreen. This will allow us to navigate the user back instead of displaying an error page. Below is a simplified version of the implementation:What alternative solutions did you explore? (Optional)
ReportScreenis the most consistent and reliable approach.truph01 commentedon Feb 2, 2026
@paulnjs 's proposal looks good and works well.
🎀 👀 🎀 C+ reviewed
25 remaining items
melvin-bot commentedon Mar 6, 2026
Current assignee @truph01 is eligible for the External assigner, not assigning anyone new.
[-][Awaiting Payment] Expense - Not here page is displayed when a member deletes an expense[/-][+][$250] [Awaiting Payment] Expense - Not here page is displayed when a member deletes an expense[/+]melvin-bot commentedon Mar 6, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022029940815548658628
pecanoro commentedon Mar 6, 2026
I re-added the label so the issue could be created in Upwork
MelvinBot commentedon Mar 6, 2026
🔍 Issue Analysis
Summary: When User A is viewing an expense report (opened via
SearchMoneyRequestReportPage) and User B deletes that expense, User A sees a "Not here" page instead of being navigated back.Status: This issue already has an approved proposal from
paulnjs(comment) and a merged fix in PR #81620.Root Cause: The bug is in
SearchMoneyRequestReportPage.tsx, notReportScreen.tsx. The page has ashouldShowAccessErrorPageuseMemo that evaluates totrueduring pending deletion states (isReportPendingDeletion,wereAllTransactionsDeleted, etc.), renderingFullPageNotFoundViewimmediately. While there is an existingdismissModaluseEffect (lines 83-100) that handles full report removal from Onyx, it only fires when the report object becomes completelynull— which happens after the pending deletion state triggers the "Not here" page. The timing gap between pending deletion (where the NotFound view renders) and full Onyx removal (where dismissModal fires) is what causes the bug.Fix (already merged): The merged PR added a
useEffectthat detects when the report enters a deletion/removal state and callsNavigation.dismissModal()before theshouldShowAccessErrorPagecan render the NotFound view, aligning with the pattern used inReportScreen.tsx.Detailed Investigation
Root Cause Analysis
The
SearchMoneyRequestReportPage.tsxpage has two competing mechanisms:shouldShowAccessErrorPage(lines 327-358): AuseMemothat returnstruewhenisReportPendingDeletion,wereAllTransactionsDeleted,wasParentActionDeleted, orisThreadReportDeletedForReviewis true. This triggersFullPageNotFoundViewat line 404.dismissModaluseEffect (lines 83-100): Detects whenreportbecomesnull(full Onyx removal) whileprevReportwas a money request report, then callsNavigation.dismissModal().The problem: When User B deletes an expense, the deletion goes through stages:
pendingAction=DELETE)shouldShowAccessErrorPagefires immediately at this stage, showing the "Not here" pagedismissModaluseEffectIn contrast,
ReportScreen.tsxhandles this correctly by using theuseReportWasDeletedhook plus an inlineisRemovalExpectedForReportTypecheck that both navigate away before the NotFound view can render.Evidence Chain
shouldShowAccessErrorPageatApp/src/pages/Search/SearchMoneyRequestReportPage.tsx:327-358→ evaluatestrueduring pending deletionFullPageNotFoundViewatApp/src/pages/Search/SearchMoneyRequestReportPage.tsx:404-410→ renders "Not here" pagedismissModalatApp/src/pages/Search/SearchMoneyRequestReportPage.tsx:83-100→ only fires on full Onyx removal (too late)ReportScreen.tsxcomparison atApp/src/pages/inbox/ReportScreen.tsx:701-768,798-820→ handles both pending deletion and full removalRelevant Code
App/src/pages/Search/SearchMoneyRequestReportPage.tsx:83-100- Existing dismissModal useEffect (insufficient for pending deletion)App/src/pages/Search/SearchMoneyRequestReportPage.tsx:327-358- shouldShowAccessErrorPage condition that triggers the bugApp/src/pages/inbox/ReportScreen.tsx:701-768- ReportScreen's more comprehensive deletion handling (for comparison)Note: This issue is already resolved — the approved proposal from
paulnjswas implemented in PR #81620 (merged 2026-02-17). The issue is currently inAwaiting Paymentstatus.bfitzexpensify commentedon Mar 6, 2026
Payment summary:
@truph01 owed $250 via NewDot manual request
@paulnjs owed $250 via Upwork - offer sent
bfitzexpensify commentedon Mar 7, 2026
Payments complete
JmillsExpensify commentedon Mar 18, 2026
$250 approved for @truph01