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-06-08] [$250] [Exploratory] Spend-Send invoice navigates to “Hmm not here” and inconsistent back navigation #89259
Version Number: V9.3.64-23 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/13176671/test-cases/41237461 Email or phone of affected tester (no customers):dreamnitethedragon+vegst@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redmi note 10s android 13 App Component: User Settings
Action Performed:
Launch app
Login with new gmail account via get paid by employer
Go to Spend
Search Type: invoice
Tap send invoice
Note directed to hmm not here
Tap device back button and note user directed to previous page correctly
Tap send invoice again
Tap app top left arrow in hmm not here page
Note user not directed to previous page instead directed to workspace page
Expected Result:
Instead of showing the “Hmm not here” page, the app should display a proper empty-state or informative screen indicating that no workspace is available or required to send invoices.
Using the top-left back arrow on the “Hmm not here” page should consistently redirect the user back to the previous page (Spend/search page), same as the device back button behavior.
Actual Result:
When a new user without any workspace taps “Send invoice” from Spend → Search → Type: Invoice, the app redirects to the “Hmm not here” page.
After tapping “Send invoice” the second time and using the top-left back arrow on the “Hmm not here” page, the user is redirected to the workspace page instead of the previous Spend/search page.
1. "Send invoice" navigates to "Hmm not here": When a user without an admin workspace taps "Send invoice" from the empty search view, EmptySearchView.tsx calls startMoneyRequest(INVOICE, generateReportID()), which navigates to IOURequestStartPage. That page wraps content in AccessOrNotFoundWrapper, which evaluates the CREATE access variant. This calls canSendInvoice(), which returns false for users with no admin workspace that has invoices enabled — causing the not-found page to render.
2. Inconsistent back navigation:PageNotFoundFallback checks isPolicyNotAccessible first. Since the policy is undefined (the randomly generated reportID has no associated report/policy), isPolicyNotAccessible is true, so it calls goBackFromWorkspaceSettingPages(). That function checks if the previous route is REPORTS_SPLIT_NAVIGATOR; since the user came from Search, it navigates to WORKSPACES_LIST instead of going back. The hardware back button works correctly because IOURequestStartPage registers useAndroidBackButtonHandler which calls Navigation.closeRHPFlow(), bypassing this logic entirely.
What changes do you think we should make in order to solve the problem?
In PageNotFoundFallback, when isMoneyRequest is true and isPolicyNotAccessible is true, the back button should call Navigation.goBack() without a route argument (or use Navigation.closeRHPFlow()) instead of calling goBackFromWorkspaceSettingPages(). The current code conflates two scenarios: accessing an inaccessible workspace settings page vs. a money request flow failing an access check with no workspace context. The fix should add an isMoneyRequest check before the isPolicyNotAccessible branch:
if (isPolicyNotAccessible) {
+ if (isMoneyRequest) {
+ Navigation.goBack();
+ return;
+ }
goBackFromWorkspaceSettingPages();
return;
}
What alternative solutions did you explore? (Optional)
Hiding the "Send invoice" button in EmptySearchView when canSendInvoice is false would prevent the user from reaching this page at all. However, this doesn't fix the general back-navigation bug for money request not-found pages, and the button visibility may be intentional to prompt workspace creation.
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.
changed the title [-][Exploratory] Spend-Send invoice navigates to “Hmm not here” and inconsistent back navigation[/-][+][$250] [Exploratory] Spend-Send invoice navigates to “Hmm not here” and inconsistent back navigation[/+]on May 13, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-13 18:10:23 UTC.
Proposal
What is the root cause of that problem?
Symptom 1 — “Hmm… it’s not here” instead of a helpful empty state
Spend → Search → type Invoice → empty results always offered Send invoice, which called startMoneyRequest(INVOICE, …) with no prior check. The invoice start screen is wrapped in AccessOrNotFoundWrapper with CREATE access. For iouType === INVOICE, that path requires canSendInvoice(allPolicies, login) (admin workspace with invoicing enabled). When that is false, the wrapper shows the generic not-found page. So the UI advertised an action the access layer is defined to reject.
Symptom 2 — header back vs device back disagreed on the not-found screen
PageNotFoundFallback handled isPolicyNotAccessible first and called goBackFromWorkspaceSettingPages(), which can send the user to Workspaces when the root stack does not look like inbox under the modal. The money-request start screen’s device back still runs Navigation.closeRHPFlow() from IOURequestStartPage while that route is focused, so users saw two different exit strategies for the same blocked flow. This is not tied to “get paid by employer” or small screens only; it is policy capability + which back handler runs.
What changes do you think we should make in order to solve the problem?
A — Gate the invoice empty state on the same rule as invoice creation (primary fix for Symptom 1)
Compute userCanSendInvoice with canSendInvoice(allPolicies, login) (same idea as FAB InvoiceMenuItem).
Only show Send invoice when true.
When false: show new copy under search.searchResults.emptyInvoiceResults.*CannotSend* and offer New workspace → ROUTES.WORKSPACE_CONFIRMATION.getRoute(Navigation.getActiveRoute()) when policy creation is not restricted; otherwise only the restricted subtitle.
B — Money-request not-found uses the same RHP exit as the live IOU screen (primary fix for Symptom 2 + wide layout)
In PageNotFoundFallback, if isMoneyRequest, call Navigation.closeRHPFlow() and return beforegoBackFromWorkspaceSettingPages() / generic goBack.
Keep goBackFromWorkspaceSettingPages() for real workspace-settings not-found (!isMoneyRequest && isPolicyNotAccessible).
Set shouldShowBackButton to true when isMoneyRequest so wide layouts still get a header back that matches the flow exit.
C — Tests and locales
Extend tests/ui/components/EmptySearchViewTest.tsx: SESSION + CurrentUserPersonalDetailsProvider; cases for cannot-send vs invoice-eligible policy (areInvoicesEnabled, admin).
Add the three new keys next to existing emptyInvoiceResults strings in all shipped locale files so TranslationDeepObject<typeof en> stays aligned.
Minimal diff (for understanding only — not the full patch)
AccessOrNotFoundWrapper.tsx — money request exits the RHP first; workspace path unchanged for non–money-request.
EmptySearchView.tsx — invoice branch: subtitle + buttons from capability (conceptual).
+const userCanSendInvoice = canSendInvoice(allPolicies, currentUserLogin);+// subtitle: invoiceSubtitleKey from cannot-send vs can-send + hasSeenTour / restricted+// buttons: test drive (optional) + either Send invoice OR New workspace (if allowed)
What alternative solutions did you explore? (Optional)
Back-only change in PageNotFoundFallback: Fixes Symptom 2 but users still hit not-found from Search if any other CTA or deep link starts invoice without capability.
Hide invoice type in Search when !canSendInvoice: Search already keeps Invoice visible when the user has invoice-related history but may not be allowed to send; hiding the type is the wrong product tradeoff; fixing the empty-state CTA matches the issue’s “informative empty state” expectation.
Weakening canSendInvoice in the wrapper: Rejected; security/product boundary should stay; UX belongs in Search empty state + consistent exit on not-found.
Reminder: Plain English, brief. No PR unless hired. Minimal snippets above are illustrative; full change is in branch diff (~189 insertions / 32 deletions across 13 files).
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
This is a minor bug, I don’t think we need to create a regression test here.
If there are posts on the PR or issue that reference a regression or deploy blocker, C+ posts on the issue and confirms regression (which will reduce pay by 50%) or provides reasoning why they shouldn’t be considered. If the C+ doesn’t update the issue, the contributor manager making the payment will assume any mention of a regression or deploy blockers reduces the issue amount.
Deploy Blocker ##92094 was identified to be related to the PR ##90760 that attempted to fix this issue.
@mallenexpensify The linked issue was simply a mistake in the PR test steps. I reviewed Melvin's steps then requested some PR changes, but I missed asking him to update the test steps as well.
I've quickly fixed the steps and requested a QA retest here: #90760 (comment).
Since this was only a test-step issue and not a problem with the implementation itself, I hope it won't affect the payment.
The BZ member will need to manually hire dangrous for the Contributor role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!
Activity
MelvinBot commentedon May 13, 2026
Proposal
What is the root cause of that problem?
There are two issues here:
1. "Send invoice" navigates to "Hmm not here": When a user without an admin workspace taps "Send invoice" from the empty search view,
EmptySearchView.tsxcallsstartMoneyRequest(INVOICE, generateReportID()), which navigates toIOURequestStartPage. That page wraps content inAccessOrNotFoundWrapper, which evaluates theCREATEaccess variant. This callscanSendInvoice(), which returnsfalsefor users with no admin workspace that has invoices enabled — causing the not-found page to render.2. Inconsistent back navigation:
PageNotFoundFallbackchecksisPolicyNotAccessiblefirst. Since the policy isundefined(the randomly generated reportID has no associated report/policy),isPolicyNotAccessibleistrue, so it callsgoBackFromWorkspaceSettingPages(). That function checks if the previous route isREPORTS_SPLIT_NAVIGATOR; since the user came from Search, it navigates toWORKSPACES_LISTinstead of going back. The hardware back button works correctly becauseIOURequestStartPageregistersuseAndroidBackButtonHandlerwhich callsNavigation.closeRHPFlow(), bypassing this logic entirely.What changes do you think we should make in order to solve the problem?
In
PageNotFoundFallback, whenisMoneyRequestistrueandisPolicyNotAccessibleistrue, the back button should callNavigation.goBack()without a route argument (or useNavigation.closeRHPFlow()) instead of callinggoBackFromWorkspaceSettingPages(). The current code conflates two scenarios: accessing an inaccessible workspace settings page vs. a money request flow failing an access check with no workspace context. The fix should add anisMoneyRequestcheck before theisPolicyNotAccessiblebranch:What alternative solutions did you explore? (Optional)
EmptySearchViewwhencanSendInvoiceis false would prevent the user from reaching this page at all. However, this doesn't fix the general back-navigation bug for money request not-found pages, and the button visibility may be intentional to prompt workspace creation.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.melvin-bot commentedon May 13, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (
External)[-][Exploratory] Spend-Send invoice navigates to “Hmm not here” and inconsistent back navigation[/-][+][$250] [Exploratory] Spend-Send invoice navigates to “Hmm not here” and inconsistent back navigation[/+]melvin-bot commentedon May 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022054387577083017709
neerajbachani commentedon May 13, 2026
🚨 Edited by proposal-police: This proposal was edited at 2026-05-13 18:10:23 UTC.
Proposal
What is the root cause of that problem?
Symptom 1 — “Hmm… it’s not here” instead of a helpful empty state
Spend → Search → type Invoice → empty results always offered Send invoice, which called
startMoneyRequest(INVOICE, …)with no prior check. The invoice start screen is wrapped inAccessOrNotFoundWrapperwithCREATEaccess. ForiouType === INVOICE, that path requirescanSendInvoice(allPolicies, login)(admin workspace with invoicing enabled). When that is false, the wrapper shows the generic not-found page. So the UI advertised an action the access layer is defined to reject.Symptom 2 — header back vs device back disagreed on the not-found screen
PageNotFoundFallbackhandledisPolicyNotAccessiblefirst and calledgoBackFromWorkspaceSettingPages(), which can send the user to Workspaces when the root stack does not look like inbox under the modal. The money-request start screen’s device back still runsNavigation.closeRHPFlow()fromIOURequestStartPagewhile that route is focused, so users saw two different exit strategies for the same blocked flow. This is not tied to “get paid by employer” or small screens only; it is policy capability + which back handler runs.What I verified in code / diff
src/pages/Search/EmptySearchView.tsx; nocanSendInvoicegate before navigation.src/pages/Search/AccessOrNotFoundWrapper.tsxPageNotFoundFallbackmixed workspace-settings back logic with money-request not-found.What changes do you think we should make in order to solve the problem?
A — Gate the invoice empty state on the same rule as invoice creation (primary fix for Symptom 1)
userCanSendInvoicewithcanSendInvoice(allPolicies, login)(same idea as FABInvoiceMenuItem).search.searchResults.emptyInvoiceResults.*CannotSend*and offer New workspace →ROUTES.WORKSPACE_CONFIRMATION.getRoute(Navigation.getActiveRoute())when policy creation is not restricted; otherwise only the restricted subtitle.B — Money-request not-found uses the same RHP exit as the live IOU screen (primary fix for Symptom 2 + wide layout)
PageNotFoundFallback, ifisMoneyRequest, callNavigation.closeRHPFlow()and return beforegoBackFromWorkspaceSettingPages()/ genericgoBack.goBackFromWorkspaceSettingPages()for real workspace-settings not-found (!isMoneyRequest && isPolicyNotAccessible).shouldShowBackButtonto true whenisMoneyRequestso wide layouts still get a header back that matches the flow exit.C — Tests and locales
tests/ui/components/EmptySearchViewTest.tsx:SESSION+CurrentUserPersonalDetailsProvider; cases for cannot-send vs invoice-eligible policy (areInvoicesEnabled, admin).emptyInvoiceResultsstrings in all shipped locale files soTranslationDeepObject<typeof en>stays aligned.Minimal diff (for understanding only — not the full patch)
AccessOrNotFoundWrapper.tsx— money request exits the RHP first; workspace path unchanged for non–money-request.onBackButtonPress={() => { + if (isMoneyRequest) { + Navigation.closeRHPFlow(); + return; + } if (isPolicyNotAccessible) { goBackFromWorkspaceSettingPages(); return; } - Navigation.goBack(policyID && !isMoneyRequest ? ROUTES.WORKSPACE_OVERVIEW.getRoute(policyID) : undefined); + Navigation.goBack(policyID ? ROUTES.WORKSPACE_OVERVIEW.getRoute(policyID) : undefined); }} - shouldShowBackButton={... ?? (!shouldShowFullScreenFallback ? shouldUseNarrowLayout : undefined)} + shouldShowBackButton={... ?? (isMoneyRequest ? true : !shouldShowFullScreenFallback ? shouldUseNarrowLayout : undefined)}EmptySearchView.tsx— invoice branch: subtitle + buttons from capability (conceptual).en.ts(same keys added in other locales):emptyInvoiceResults: { ... + subtitleCannotSendInvoice: '...', + subtitleWithOnlyCreateButtonCannotSendInvoice: '...', + subtitleCannotSendInvoiceRestricted: '...', },What alternative solutions did you explore? (Optional)
PageNotFoundFallback: Fixes Symptom 2 but users still hit not-found from Search if any other CTA or deep link starts invoice without capability.!canSendInvoice: Search already keeps Invoice visible when the user has invoice-related history but may not be allowed to send; hiding the type is the wrong product tradeoff; fixing the empty-state CTA matches the issue’s “informative empty state” expectation.canSendInvoicein the wrapper: Rejected; security/product boundary should stay; UX belongs in Search empty state + consistent exit on not-found.Reminder: Plain English, brief. No PR unless hired. Minimal snippets above are illustrative; full change is in branch diff (~189 insertions / 32 deletions across 13 files).
Results:
44 remaining items
ahmedGaber93 commentedon Jun 7, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: https://github.com/Expensify/App/pull/52059/changes#r3369548681
Link to the comment on the Issue: [HOLD for payment 2024-12-17] [$250] Search - When plenty of expenses are created already, haven't created expenses message shown #51168 (comment)
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
This is a minor bug, I don’t think we need to create a regression test here.
melvin-bot commentedon Jun 7, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jun 8, 2026
@ahmedGaber93 from the C+ doc
ahmedGaber93 commentedon Jun 9, 2026
@mallenexpensify The linked issue was simply a mistake in the PR test steps. I reviewed Melvin's steps then requested some PR changes, but I missed asking him to update the test steps as well.
I've quickly fixed the steps and requested a QA retest here: #90760 (comment).
Since this was only a test-step issue and not a problem with the implementation itself, I hope it won't affect the payment.
melvin-bot commentedon Jun 9, 2026
The BZ member will need to manually hire dangrous for the Contributor role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!
mallenexpensify commentedon Jun 9, 2026
Payment Summary
Contributor+: @ahmedGaber93 due $250 via NewDot
Thx for the reasoning @ahmedGaber93 ,
flaviadefaria commentedon Jul 31, 2026
Approved: @ahmedGaber93 due $250 via NewDot