[Due for payment 2026-11-13] [$250] Spend - It's not here page when opening a split expense from chat filter
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.5.10-0 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/57529521/test-cases/41237507 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: MacOS Safari App Component: Left Hand Navigation (LHN)
Action Performed:
- Launch new Expensify logged on
- Go to a chat with a user and click on the plus icon > Split expense
- Add an amount an confirm
- Go to Spend > Expenses and click on Filters
- Select Type > Chat
- Scroll down until you find the original split expense and click on it
Expected Result:
The expense is opened on any correct view (Edit split expenses maybe) or it's not shown at all
Actual Result:
The error message "Hmm... it's not here" is not show
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [ ] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome Safari
Screenshots/Videos
https://github.com/user-attachments/assets/871d5bb8-4eca-4dae-8d3f-4439905ef75d
Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7287440
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022110831219914409226
- Upwork Job ID: 2110831219914409226
- Last Price Increase: 2026-11-01
Issue Owner
Current Issue Owner: @mallenexpensify
While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/7489a3856e824a296460b9f6b90a269f2173a172824b50415f3dfd2a7b7518e4
Proposal
What is the root cause of that problem?
In a Type: Chat search result, a split action renders its own preview card. Clicking that card runs the split branch of onPreviewPressed, which builds the split-details route without a base path:
ChatTransactionPreview.tsx:70-74
createDynamicRoute then appends split/<reportActionID> to the current route (createDynamicRoute.ts:83). On Spend that gives search/split/<reportActionID>. The Search root is not in SPLIT_BILL_DETAILS.entryScreens (ROUTES.ts:1745-1749). As a result, getStateFromPath rejects the match and falls back to the * NotFound screen (getStateFromPath.ts:46-75).
The non-split branch in the same handler already uses the Search-aware getReportRouteForCurrentContext. The split branch was never updated to match.
What changes do you think we should make in order to solve the problem?
In the split branch of ChatTransactionPreview, pass an explicit base path when Search is the focused full-screen route. Use ROUTES.SEARCH_REPORT for the chat that owns the action (reportID, which is already a prop). The result is search/view/<chatReportID>/split/<reportActionID>, which:
- passes the
entryScreenscheck, becauseSEARCH_REPORTis allowed - gives the split details page the
reportIDparam it needs
Keep the current behavior when the preview is clicked inside a report or an RHP, where the active route is already a valid base.
Add a test: press a split preview rendered from a Search chat row, then expect a route under search/view/<reportID>/split/.
What alternative solutions did you explore? (Optional)
- Disable the preview's own press inside Search chat rows. The row's
onSelectRowwould then open the chat at that action. This is simpler but doesn't open the split details. - Only add
SCREENS.SEARCH.ROOTtoentryScreens. This is not enough: the Search root has noreportIDparam, sowithReportAndReportActionOrNotFoundwould still show not-found.
Investigation details
- Search rows render through
ReportActionItem. For a split IOU action,ActionContentRouterrendersChatTransactionPreviewwithshouldShowSplitPreview=true(ActionContentRouter.tsx:184-204). Regular IOU actions in a DM returnnull, so they have no inner card. - The card's
PressableWithoutFeedbackhandles the click before the row'sonSelectRow(TransactionPreview/index.tsx:102-105). - A click on the row outside the card opens
SEARCH_REPORTfor the DM, which loads correctly (Search/index.tsx:784-800). - Preserve Search context for expense previews made the non-split branch Search-aware but left the split branch unchanged.
- I tried to reproduce this on web. The split $10.00 action appeared under Type: Chat, but clicking it caused no navigation, so I could not confirm the not-found screen in the app. The root cause above comes from reading the code, so confidence is medium.
Next Steps for Contributor+ team:
To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104161) to create a draft PR.
To refine: @MelvinBot <your feedback>
To reject: Explain why you are rejecting Melvin's proposal.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mkhutornyi (External)
Job added to Upwork: https://www.upwork.com/jobs/~022110831219914409226
Proposal
Please re-state the problem that we are trying to solve in this issue.
Opening a split expense preview from Search chat results (Spend > Expenses > Filters > Type > Chat) displays "Hmm... it's not here".
What is the root cause of that problem?
In ChatTransactionPreview.tsx:70-74, clicking a split preview calls createDynamicRoute without basePath.
When Search is active, createDynamicRoute defaults to getActiveRoute() (search), creating search/split/<reportActionID>. However, DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.entryScreens (ROUTES.ts:1745-1749) only allows REPORT and modal screens (SEARCH_REPORT, EXPENSE_REPORT). Because search is not an allowed entry screen and lacks reportID, navigation fails and renders NotFound.
What changes do you think we should make in order to solve the problem?
Pass ROUTES.SEARCH_REPORT.getRoute({reportID}) as basePath to createDynamicRoute when Search is the topmost full-screen route:
--- a/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
+++ b/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
@@ -71,3 +71,4 @@
onPreviewPressed={() => {
if (shouldShowSplitPreview) {
- Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID)));
+ const basePath = isSearchTopmostFullScreenRoute() && reportID ? ROUTES.SEARCH_REPORT.getRoute({reportID}) : undefined;
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID), basePath));
return;
}
What alternative solutions did you explore? (Optional)
None.
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0170d6b02e9440e604
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/janithad
Proposal
Please re-state the problem that we are trying to solve in this issue.
When opening a split expense preview from Search chat results (Spend > Expenses > Filters > Type > Chat), the app displays the "Hmm... it's not here" (NotFound) screen.
What is the root cause of that problem?
In src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx:70-74:
onPreviewPressed={() => {
if (shouldShowSplitPreview) {
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID)));
return;
}
-
Missing
basePathincreateDynamicRoute:
When clicked from the Search screen,createDynamicRoutedefaults togetActiveRoute(), which is/search. It constructs the dynamic route:
/search/split/:reportActionID. -
Entry screen validation failure in
getStateFromPath:
InROUTES.ts:1745-1749:SPLIT_BILL_DETAILS: { path: 'split/:reportActionID', entryScreens: [SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT], getRoute: (reportActionID: string) => `split/${reportActionID}` as const, },SCREENS.SEARCH.ROOT(/search) is not inentryScreensand has noreportIDparameter. Consequently,getStateFromPathrejects the dynamic route candidate and falls back toSCREENS.NOT_FOUND("Hmm... it's not here"). -
Inconsistency with non-split preview branch:
In the same file (ChatTransactionPreview.tsx:90, 96), PR #92659 updated the non-split branches to use the Search-aware helpergetReportRouteForCurrentContext({reportID: ...}). However, the split branch was overlooked and remained without a base route.
What changes do you think we should make in order to solve the problem?
In src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx:
Use the already-imported getReportRouteForCurrentContext helper to supply the basePath when reportID is present:
--- a/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
+++ b/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
@@ -70,5 +70,6 @@ function ChatTransactionPreview({action, reportID, chatReport, iouReport, shoul
onPreviewPressed={() => {
if (shouldShowSplitPreview) {
- Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID)));
+ const baseReportRoute = reportID ? getReportRouteForCurrentContext({reportID}) : undefined;
+ Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID), baseReportRoute));
return;
}
Why getReportRouteForCurrentContext is the superior, idiomatic approach:
- Preserves Search filter state via
backTo:getReportRouteForCurrentContextautomatically computesbackTo = Navigation.getActiveRoute()and routes toROUTES.SEARCH_REPORT.getRoute({reportID, backTo}). When the user closes or navigates back from the split details screen, they return seamlessly to their filtered Search view with active filters intact. - DRY & Unified: It reuses the exact same pattern already imported and used on lines 90 and 96 for transaction threads without introducing redundant duplicate checks (
isSearchTopmostFullScreenRoute) in the component. - Universal compatibility: When rendered inside a standard report,
getReportRouteForCurrentContextreturnsROUTES.REPORT_WITH_ID(r/:reportID), maintaining 100% existing functionality.
What alternative solutions did you explore? (Optional)
- Directly passing
ROUTES.SEARCH_REPORT.getRoute({reportID}): Suboptimal because omittingbackTobreaks the back-navigation chain, causing the user to lose their current Search filter state upon dismissing the modal. - Adding
SCREENS.SEARCH.ROOTtoDYNAMIC_ROUTES.SPLIT_BILL_DETAILS.entryScreens: Not viable because the root Search screen lacks areportIDparameter needed by split details.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@mkhutornyi I reproduced the bug and noticed a key issue with MelvinBot's direction:
Melvin suggests manually building search/view/<reportID>/split/<reportActionID>, but completely leaves out backTo. PR #92659 introduced getReportRouteForCurrentContext specifically so previews opened from Search carry backTo to preserve active filters across page reloads and back navigation.
Also, we don't need to build routes manually. ChatTransactionPreview already imports and uses getReportRouteForCurrentContext for other actions. Using it only when Search is active (isSearchTopmostFullScreenRoute) fixes the bug, preserves Search filters on back navigation, and avoids adding unnecessary query parameters to normal chat URLs.
Repro demo
https://github.com/user-attachments/assets/63fc3542-dd27-48b1-b0d1-776ddef238a7
I have tested this fix locally. Would you like me to post the full proposal?
Fix demo
https://github.com/user-attachments/assets/58b88a0c-00da-4df5-8a70-c542c4414108
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa
Proposal
Please re-state the problem that we are trying to solve in this issue.
When opening a split expense preview from Search results (Spend > Expenses > Filters > Type > Chat), the application fails to resolve the route and renders the "Hmm... it's not here" (NotFound) screen.
What is the root cause of that problem?
In src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx (lines 70–74):
onPreviewPressed={() => {
if (shouldShowSplitPreview) {
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID)));
return;
}
createDynamicRoutewas called without abasePathparameter. When omitted,createDynamicRoutefalls back togetActiveRoute(). When opening the preview from Search,getActiveRoute()resolves to/search.- This generates
/search/split/:reportActionID. - In
DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.entryScreens:entryScreens: [SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT]SCREENS.SEARCH.ROOT(/search) is not an allowed entry screen and has noreportIDparameter. Consequently,getStateFromPathfails to match the dynamic route candidate and falls back toSCREENS.NOT_FOUND. - While lines 90 and 96 in
ChatTransactionPreview.tsxwere already updated to usegetReportRouteForCurrentContext({reportID: ...})to properly contextualize transaction thread routes for Search, the split bill branch was omitted.
What changes do you think we should make in order to solve the problem?
In src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx:
Supply baseReportRoute computed via getReportRouteForCurrentContext({reportID}) as the second argument to createDynamicRoute:
--- a/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
+++ b/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
@@ -69,7 +69,8 @@ function ChatTransactionPreview({action, reportID, chatReport, iouReport, should
transactionPreviewWidth={reportPreviewStyles.transactionPreviewStandaloneStyle.width}
onPreviewPressed={() => {
if (shouldShowSplitPreview) {
- Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID)));
+ const baseReportRoute = reportID ? getReportRouteForCurrentContext({reportID}) : undefined;
+ Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID), baseReportRoute));
return;
}
- When clicked inside Search (
isSearchTopmostFullScreenRoute()),getReportRouteForCurrentContextreturnsROUTES.SEARCH_REPORT.getRoute({reportID, backTo}). The route resolves cleanly as a child of SearchReport withbackTopreserved, allowing the user to dismiss split bill details and return directly to their filtered Search state. - When clicked inside standard Chat reports,
getReportRouteForCurrentContextreturnsROUTES.REPORT_WITH_ID.getRoute({reportID}), retaining 100% normal behavior.
Pre-coded and tested in branch: fix/104161-split-bill-details-search-base-route (https://github.com/jloa-dev/App/tree/fix/104161-split-bill-details-search-base-route).
What alternative solutions did you explore? (Optional)
Directly passing ROUTES.SEARCH_REPORT.getRoute({reportID}). However, that omits the active backTo query parameter provided automatically by getReportRouteForCurrentContext, which would cause users to lose their Search filters upon navigating back.
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@mkhutornyi Huh... This is 4 days overdue. Who can take care of this?
@mkhutornyi Still overdue 6 days?! Let's take care of this!
Proposal
Please re-state the problem that we are trying to solve in this issue.
When opening a split expense preview from Search results (Spend > Expenses > Filters > Type > Chat), the app navigates to an invalid route and displays the "Hmm... it's not here" (NotFound) page instead of opening the split expense details.
What is the root cause of that problem?
- In
src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx:75-79, pressing a split expense preview callscreateDynamicRoutewithout abasePath:if (shouldShowSplitPreview) { Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID))); return; } - When
basePathis omitted,createDynamicRoute(src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute.ts:83) resolves againstgetActiveRoute(). When pressing the split preview directly from a Search results row (SCREENS.SEARCH.ROOT),getActiveRoute()issearch?q=..., producingsearch/split/<reportActionID>?q=.... - In
getStateFromPath(src/libs/Navigation/helpers/getStateFromPath.ts:38-75), the focused route parsed frompathWithoutDynamicSuffixisSCREENS.SEARCH.ROOT, which is not inDYNAMIC_ROUTES.SPLIT_BILL_DETAILS.entryScreens(src/ROUTES.ts:1750-1754:[SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT]) and lacks thereportIDrequired by the split details page (src/pages/iou/DynamicSplitBillDetailsPage.tsx:158,217). Consequently,getStateFromPathrejects the dynamic suffix and falls back toSCREENS.NOT_FOUND. - Crucially, we must distinguish between two contexts when
Searchis the underlying fullscreen tab:- Pressed directly from a Search list row (
isOnSearch === trueviauseIsOnSearch()): The active route isSCREENS.SEARCH.ROOT(search?q=...), which is not a validentryScreen. Here we needgetReportRouteForCurrentContext({reportID})(src/libs/Navigation/helpers/getReportRouteForCurrentContext.ts:13-24), which returnsROUTES.SEARCH_REPORT.getRoute({reportID, backTo: Navigation.getActiveRoute()})(search/view/<reportID>?backTo=...). - Pressed inside an already-open RHP report (
SCREENS.RIGHT_MODAL.SEARCH_REPORT,EXPENSE_REPORT,SEARCH_MONEY_REQUEST_REPORT) or standard Chat report (SCREENS.REPORT), whereisOnSearch === false: The active route is already a validentryScreen(and inSEARCH_REPORT,getActiveRoute()is alreadysearch/view/<reportID>?backTo=<searchQuery>).- Calling
getReportRouteForCurrentContext({reportID})unconditionally would append a redundantbackTopointing to the current report route to standard chat split URLs and overwriteEXPENSE_REPORT/SEARCH_MONEY_REQUEST_REPORTRHP base paths. - Gating on
isSearchTopmostFullScreenRoute()alone (instead ofuseIsOnSearch()) would still trigger inside an already-openSEARCH_REPORTRHP—becausegetTopmostFullScreenRoute()remainsNAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR—causinggetReportRouteForCurrentContextto setbackTo = Navigation.getActiveRoute()(search/view/<reportID>...), replacing the Search return target with the currentSEARCH_REPORTURL (an unnecessary nested return target).
- Calling
- Pressed directly from a Search list row (
What changes do you think we should make in order to solve the problem?
In src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx, use useIsOnSearch() from @components/Search/SearchScopeProvider (matching src/pages/inbox/report/ReportActionItem.tsx:281, src/pages/inbox/report/ReportActionItemSingle.tsx:81, and tests/ui/ChatTransactionPreviewTest.tsx:86) and pass getReportRouteForCurrentContext({reportID}) as basePath to createDynamicRoute when isOnSearch && reportID is truthy:
--- a/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
+++ b/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx
@@ -1,5 +1,6 @@
import {usePersonalDetails} from '@components/OnyxListItemProvider';
import TransactionPreview from '@components/ReportActionItem/TransactionPreview';
+import {useIsOnSearch} from '@components/Search/SearchScopeProvider';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useOnyx from '@hooks/useOnyx';
@@ -49,6 +50,7 @@
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const {shouldUseNarrowLayout} = useResponsiveLayout();
+ const isOnSearch = useIsOnSearch();
const personalDetail = useCurrentUserPersonalDetails();
const personalDetails = usePersonalDetails();
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
@@ -74,7 +76,8 @@
transactionPreviewWidth={reportPreviewStyles.transactionPreviewStandaloneStyle.width}
onPreviewPressed={() => {
if (shouldShowSplitPreview) {
- Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID)));
+ const basePath = isOnSearch && reportID ? getReportRouteForCurrentContext({reportID}) : undefined;
+ Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID), basePath));
return;
}
Why this works across all entry points:
- From a Search list row (
isOnSearch === true):getReportRouteForCurrentContext({reportID})producessearch/view/<reportID>?backTo=<encodedSearchRoute>, andcreateDynamicRoutecombines them intosearch/view/<reportID>/split/<reportActionID>?backTo=<encodedSearchRoute>.SCREENS.RIGHT_MODAL.SEARCH_REPORTpassesentryScreensvalidation, suppliesreportIDtoDynamicSplitBillDetailsPage, and preserves the active Search filters inbackTo. - From inside an already-open
SEARCH_REPORTRHP,EXPENSE_REPORTRHP, or standardREPORT(isOnSearch === false):basePathisundefined, socreateDynamicRouteappends/split/<reportActionID>directly to the active route without overwriting the RHP's existingbackToparameter or adding unnecessary?backToparams to standard chat URLs.
Regression coverage to add in tests/ui/ChatTransactionPreviewTest.tsx:
- Render a split preview inside
SearchScopeProvider, with Search as the topmost fullscreen route and an active filtered Search URL. Press it and assert asearch/view/<reportID>/split/<reportActionID>destination whose decodedbackToequals the original Search URL. - Render outside the Search scope with an already-open
SEARCH_REPORTabove Search. Assert the existing base path and decodedbackToare retained, rather than nesting the current report URL inbackTo. - Repeat outside the Search scope for
REPORT,EXPENSE_REPORT, andSEARCH_MONEY_REQUEST_REPORT; preserve each active base path and its query parameters, cover a missingreportID, and leave the existing non-split test passing (SearchScopeProviderwraps only the Search list insrc/components/Search/index.tsx:1486,1610and defaults toisOnSearch: falseoutside a provider insrc/components/Search/SearchScopeProvider.tsx:5-24).
What alternative solutions did you explore? (Optional)
- Passing
ROUTES.SEARCH_REPORT.getRoute({reportID})withoutbackTo: Loses the active Search query/filter state when navigating back or reloading, and if gated onisSearchTopmostFullScreenRoute(), strips the existingbackToparameter when pressing a split preview inside an already-openSEARCH_REPORTRHP. - Calling
getReportRouteForCurrentContext({reportID})unconditionally or gating onisSearchTopmostFullScreenRoute(): Unconditional calls add a redundantbackToto normal chat split URLs and breakEXPENSE_REPORTRHP base paths; gating onisSearchTopmostFullScreenRoute()still runs whenSEARCH_REPORTis already open in the RHP on top of Search, overwriting the original SearchbackTowith the currentSEARCH_REPORTURL.
@mkhutornyi this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Melvin's solution causes regression when refresh split bill detail page.
https://github.com/user-attachments/assets/cb4f81dc-e06b-4e06-affd-82522674dd95
Proposal
What is the root cause of that problem?
Pressing a split preview builds a dynamic route with no base path:
https://github.com/Expensify/App/blob/1191e7b2fba721b609ec645880a4ce4456cda1ac/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx#L76-L79
So createDynamicRoute appends split/<reportActionID> to the active route, which on Spend is search?q=... (https://github.com/Expensify/App/blob/1191e7b2fba721b609ec645880a4ce4456cda1ac/src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute.ts#L83).
The Search root is not in SPLIT_BILL_DETAILS.entryScreens, so getStateFromPath rejects the match and falls back to Not Found:
https://github.com/Expensify/App/blob/1191e7b2fba721b609ec645880a4ce4456cda1ac/src/ROUTES.ts#L1862-L1866 https://github.com/Expensify/App/blob/1191e7b2fba721b609ec645880a4ce4456cda1ac/src/libs/Navigation/helpers/getStateFromPath.ts#L48
This came from #92052, which replaced the absolute r/:reportID/split/:reportActionID route with the dynamic one.
What changes do you think we should make in order to solve the problem?
Allow the split details route to open from the Search root, and pass the chat's reportID as a query param since the Search root has none. This is the same pattern REPORT_DETAILS already uses (https://github.com/Expensify/App/blob/1191e7b2fba721b609ec645880a4ce4456cda1ac/src/ROUTES.ts#L1706-L1718).
SPLIT_BILL_DETAILS: {
path: 'split/:reportActionID',
- entryScreens: [SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT],
- getRoute: (reportActionID: string) => `split/${reportActionID}` as const,
+ entryScreens: [SCREENS.REPORT, SCREENS.RIGHT_MODAL.SEARCH_REPORT, SCREENS.RIGHT_MODAL.EXPENSE_REPORT, SCREENS.RIGHT_MODAL.SEARCH_MONEY_REQUEST_REPORT, SCREENS.SEARCH.ROOT],
+ getRoute: (reportActionID: string, reportID?: string) => getUrlWithParams(`split/${reportActionID}`, {reportID}),
+ queryParams: ['reportID'],
},
In ChatTransactionPreview, pass reportID only when pressed from the Search list (useIsOnSearch()), so the report and RHP paths keep their current URLs:
+ const isOnSearch = useIsOnSearch();
...
- Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID)));
+ Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID, isOnSearch ? reportID : undefined)));
The route becomes search/split/<reportActionID>?q=...&reportID=<chatReportID>. Back strips the suffix and the declared reportID (https://github.com/Expensify/App/blob/1191e7b2fba721b609ec645880a4ce4456cda1ac/src/hooks/useDynamicBackPath.ts#L36), so it returns to the filtered Search, also after a refresh.
What alternative solutions did you explore? (Optional)
Using ROUTES.SEARCH_REPORT (with or without backTo) as the base path. It opens the page, but Back is built from the URL minus the suffix, so after a refresh Back opens the 1:1 chat RHP instead of returning to Search. Without backTo the Search filters are also lost on refresh.
Proposal
Please re-state the problem that we are trying to solve in this issue.
On Spend > Expenses with the Type filter set to Chat, clicking the split expense preview of a split created in a 1:1 chat opens a "Hmm... it's not here" page instead of the split details.
What is the root cause of that problem?
Chat-type search rows render the action with ReportActionItem, so a split action shows the regular split preview card. Pressing that card goes through ChatTransactionPreview, which builds the split details route with createDynamicRoute and no base path:
https://github.com/Expensify/App/blob/7e9ad84e6dede7bf27091b7f9accd1e85a997f2c/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx#L70-L73
Without a base path, createDynamicRoute appends split/<reportActionID> to whatever route is active. Inside a report that is r/<reportID> or search/view/<reportID>, which works. On the Spend page the active route is the search route (search?q=...), so we navigate to search/split/<reportActionID>?q=....
The SPLIT_BILL_DETAILS dynamic route only allows report screens as entry screens, and the search root screen is not among them:
https://github.com/Expensify/App/blob/7e9ad84e6dede7bf27091b7f9accd1e85a997f2c/src/ROUTES.ts#L1745-L1749
So getStateFromPath rejects the suffix match. Even if the search screen were allowed, the search route has no reportID param, and the split details page loads its report from route.params.reportID. With no report it renders NotFoundPage:
https://github.com/Expensify/App/blob/7e9ad84e6dede7bf27091b7f9accd1e85a997f2c/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx#L99-L109
What changes do you think we should make in order to solve the problem?
In ChatTransactionPreview, pass an explicit base path to createDynamicRoute for the split details route instead of relying on the active route:
- Use the existing
getValidDynamicRouteBasePathhelper withDYNAMIC_ROUTES.SPLIT_BILL_DETAILS.entryScreens. Inside a report the active route is a valid entry screen and stays the base, so the chat and report flows are unchanged. - As the fallback path, use
getReportRouteForCurrentContext({reportID})(already imported in this file). On the Spend page it resolves tosearch/view/<chatReportID>, which is an allowed entry screen and carriesreportID, so the split details page opens in the search RHP with the right chat report and split action.
https://github.com/Expensify/App/blob/7e9ad84e6dede7bf27091b7f9accd1e85a997f2c/src/libs/Navigation/helpers/getValidDynamicRouteBasePath.ts#L16-L35
The result: clicking the split preview from the Chat filter opens the split expense details, same as inside the chat.
Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/104161-split-preview-search-route?expand=1
What alternative solutions did you explore? (Optional)
Add SCREENS.SEARCH.ROOT to the SPLIT_BILL_DETAILS entry screens. That alone does not work, because the search route carries no reportID, so the split details page still cannot find the report and shows not found.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Clicking a split expense preview in Spend > Type: Chat results opens "Hmm... it's not here" instead of the split details.
What is the root cause of that problem?
There are 2 problems in the split path here, and the second one only shows up once the first is fixed.
1. The route is built on top of the Search root. The split branch of the preview press handler builds the dynamic route without a base path
https://github.com/Expensify/App/blob/364fb3ddee4fc0533e3a7e108fbffb5115e0bd73/src/pages/inbox/report/actionContents/ChatTransactionPreview.tsx#L71-L74
so createDynamicRoute appends it to the active route and we get search/split/<reportActionID>?q=.... The Search root is not in SPLIT_BILL_DETAILS.entryScreens (and it has no reportID anyway), so getStateFromPath rejects the candidate and the path falls through to NotFound. The non split branches of the same handler already use getReportRouteForCurrentContext, only this one was left behind.
2. The split page can't load its own data on wide layout. Even with a valid base, a dynamic route only builds state for the dynamic screen itself, nothing for the base screen underneath
https://github.com/Expensify/App/blob/364fb3ddee4fc0533e3a7e108fbffb5115e0bd73/src/libs/Navigation/helpers/dynamicRoutesUtils/getStateForDynamicRoute.ts#L111-L112
From a report this is fine, because the chat is already open behind the RHP and its ReportScreen has called openReport. From Search nothing has opened that chat. Search rows are rendered from the snapshot, and its report actions are kept apart from the live reportActions_ collection (Search.ts). Now withReportAndReportActionOrNotFound reads the live collection and only fetches the report on narrow layout
https://github.com/Expensify/App/blob/364fb3ddee4fc0533e3a7e108fbffb5115e0bd73/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx#L79-L82
https://github.com/Expensify/App/blob/364fb3ddee4fc0533e3a7e108fbffb5115e0bd73/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx#L97-L103
So on web/desktop, for any chat whose actions aren't in Onyx yet (fresh sign in, cleared cache, an older chat the search dug up), reportActions stays empty, isLoadingReportAction stays true and the page spins forever. The issue repro doesn't hit this only because the tester had just opened that chat in step 2. Fixing just the base path would trade NotFound for an infinite loader in that case.
What changes do you think we should make in order to solve the problem?
- In
ChatTransactionPreview, give the split route a real base, same helper as the other branches. In Search this issearch/view/<chatReportID>(an allowed entry screen that carriesreportID), in a report it staysr/<reportID>:
if (shouldShowSplitPreview) {
const basePath = reportID ? getReportRouteForCurrentContext({reportID}) : undefined;
Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_BILL_DETAILS.getRoute(action.reportActionID), basePath));
return;
}
- In
withReportAndReportActionOrNotFound, also fetch on wide layout when we have no actions at all for that report. When the chat is open underneath, actions are already there, so this never adds a secondopenReportin the normal flow:
useEffect(() => {
if (!isEmptyObject(report) && !isEmptyObject(linkedReportAction)) {
return;
}
if (!shouldUseNarrowLayout && hasReportActions) {
return;
}
openReport({...});
}, [shouldUseNarrowLayout, props.route.params.reportID, currentUserAccountID]);
Tests:
getStateFromPath('search/view/1/split/2')resolves to the split details screen, andsearch/split/2does not (this is the regression guard for 1).- Render the split details page on wide layout with the report in Onyx but no
reportActions_<id>. ExpectopenReportto be called with that reportID and the page to render once the action arrives, instead of staying on the loader.
What alternative solutions did you explore? (Optional)
- Pass
ROUTES.SEARCH_REPORT.getRoute({reportID, reportActionID: action.reportActionID, backTo})as the base. Back from split details then lands on the chat anchored at the split action, which is the same place a click on the rest of the row takes you (Search/index.tsx). - Instead of touching the HOC, have the split details page fall back to the snapshot action when the live one is missing. I'd rather not, the page also calls
completeSplitBillwith that action, and that should run on live data. - Only adding
SCREENS.SEARCH.ROOTtoentryScreensdoesn't work, the Search root has noreportID, so the HOC would still show NotFound.