App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-13] [$175] Spend - Not here page opens after clicking split row on Date tab when opened from Spend

Open applause-bot[bot] opened this issue 1 month ago • 33 comments

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.23-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/test-runs/80732943/folder/57599982/71461417/1913501751?sort=-identifier 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: Mac 26.5 / Chrome App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Go to Spend > Expenses.
  5. Select the expense via checkbox.
  6. Click More > Split.
  7. Go to Date tab.
  8. Click on any split.

Expected Result:

Split page will open.

Actual Result:

Not here page opens after clicking split row on Date tab when opened from Spend.

Workaround:

Unknown

Platforms:

  • [x] Android: App
  • [ ] Android: mWeb Chrome
  • [x] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

https://github.com/user-attachments/assets/bc697936-cab3-4ddf-ada6-da0b2d2c6c72

View all open jobs on GitHub

Applause Internal Information Exported by: Svetlana Lazutkina Bug ID: 7298089

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

applause-bot[bot] avatar Oct 27 '26 15:10 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/06b9edce8b8c1a7c18d44d420c809414048ce0528370b6dbcd55ca064fbf7bb3

applause-bot[bot] avatar Oct 27 '26 15:10 applause-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When the split flow is opened from Spend > Expenses, clicking a split row on the Date tab shows the "Hmm... it's not here" page instead of the split edit page.

What is the root cause of that problem?

A legacy URL redirect catches the split edit URL and rewrites it into a broken expense-date URL.

  • When opened from Search, the split edit URL on the Date tab is /search/split-expense-overview-search/date/split-expense/edit/<reportID>/<transactionID>. The date tab name is the third path segment.
  • The legacy pattern '/*/*/date/*/*/*' in OldRoutes.ts:222 matches any path whose third segment is date. It rewrites the URL to /r/edit/expense-date?action=search&iouType=split-expense-overview-search&transactionID=split-expense&reportID=edit….
  • Report edit and transaction split-expense don't exist, so the Not Here page shows.

This only happens from Spend, and only on the Date tab:

  • From a chat, the base is /r/<reportID>, so date is not the third segment.
  • The other tabs use amount and percentage, which no legacy pattern matches.
Code path
  1. More > Split calls initSplitExpense. Search opens split-expense-overview-search (SplitExpenses.ts:243-244).
  2. The active tab is a child path segment (amount / percentage / date) (config.ts:1961-1988).
  3. All tabs share onSelectRow. It appends the dynamic SPLIT_EXPENSE_EDIT suffix to the current path (DynamicSplitExpensePage.tsx:610-626).
  4. getMatchingNewRoute runs before normal route parsing and picks the longest matching legacy pattern. A trailing * matches the rest of the path (getMatchingNewRoute.ts:15-29). The edit page's own not-found check never runs.

Likely regression source: the clash appeared after the date legacy patterns from Migrate money request merchant, description and date steps to dynamic met the new Search split URLs from Migrate split expense routes to dynamic URL navigation and migrate SPLIT_EXPENSE_EDIT. I didn't confirm which PR first introduced it.

What changes do you think we should make in order to solve the problem?

In OldRoutes.ts, add a pass-through entry so split edit URLs under the date tab are left unchanged. The file already does this for participants at OldRoutes.ts:224.

  • Pattern: '/*/*/date/split-expense/edit/*', mapped to '/$1/$2/date/split-expense/edit/$3'.
  • It is longer than '/*/*/date/*/*/*', so it wins.

Add cases to tests/navigation/getMatchingNewRouteTest.ts:

  • The Search split edit URL under date comes back unchanged.
  • A legacy URL such as /edit/submit/date/123/456 still redirects.

What alternative solutions did you explore? (Optional)

  • Rename the Date tab's path segment in config.ts (for example, by-date) for both split screens. This fixes the clash at its source but changes existing tab URLs.
  • Make getMatchingNewRoute skip legacy redirects when the path already resolves to a registered dynamic route. This is broader and also protects against other '/*/*/<keyword>/*/*' patterns.
Web reproduction

I reproduced this on web. The Date tab row opens the Not Here page, and the Amount tab row opens the edit page.

Date tab row Amount tab row
Date tab split row opens Not here page Amount tab split row opens split edit page

Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/105152) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run · no recording available

MelvinBot avatar Oct 27 '26 16:10 MelvinBot

Triggered auto assignment to Contributor-plus team member for initial proposal review - @situchan (External)

melvin-bot[bot] avatar Oct 27 '26 16:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022115112485992206644

melvin-bot[bot] avatar Oct 27 '26 16:10 melvin-bot[bot]

Proposal

What is the root cause of that problem?

getMatchingNewRoute (src/libs/Navigation/helpers/getMatchingNewRoute.ts) runs every path through the legacy oldRoutes table and picks the longest matching pattern. Its regex is anchored (^…(?=[?#]|$)), a non-trailing * is one segment, and a trailing * is (.*).

The legacy pattern '/*/*/date/*/*/*' (OldRoutes.ts:222) matches /search/split-expense-overview-search/date/split-expense/edit/<reportID>/<transactionID>, because when the split flow is opened from Spend the Date tab name is the third segment. It rewrites it to /r/edit/expense-date?..., a report that does not exist, so Not Here shows. From a chat the base is /r/<reportID>, so date is not third. The amount and percentage tabs have no legacy pattern, so they are fine.

What changes do you think we should make in order to solve the problem?

In OldRoutes.ts, next to the participants pass-through at line 224, add: '/*/*/date/split-expense/edit/*': '/$1/$2/date/split-expense/edit/$3'. It is longer than '/*/*/date/*/*/*', so maxLength selects it and the URL comes back unchanged. The literal split-expense/edit keeps real legacy date URLs (/edit/submit/date/<txn>/<report>) redirecting.

Test, in tests/navigation/getMatchingNewRouteTest.ts (same expect(getMatchingNewRoute(...)) style):

  • The Search split-edit URL under date returns unchanged, with and without ?backTo=....
  • /edit/submit/date/123/456 still returns /r/456/expense-date?....

What alternative solutions did you explore? (Optional)

  • MelvinBot's proposal reaches the same root cause and the same pass-through. Mine adds the ?backTo case, which matters because the split-edit URL carries a query, and the guard that real legacy date URLs still redirect.
  • MelvinBot's alternatives (renaming the Date tab segment in config.ts, or making getMatchingNewRoute skip redirects for registered dynamic routes) are broader. I rejected them for this bug: the first changes existing tab URLs, the second needs a route-registry lookup inside a pure string helper.

Stephen3453 avatar Oct 27 '26 16:10 Stephen3453

VERDICT: POST ROOT_CAUSE_ONELINER: createDynamicRoute in onSelectRow uses getActiveRoute() which includes the active tab's URL segment (/date), creating an invalid nested path split-expense-overview-search/date/split-expense/edit/… that the router cannot match. PROPOSAL_TYPE: FIRST AUTOPOST_SAFE: YES

j3ffffff avatar Oct 27 '26 16:10 j3ffffff

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a user selects an expense from Spend > Expenses, taps More > Split, switches to the Date tab, and clicks on any split row, the <NotFoundPage /> ("Hmm... it's not here") error screen opens instead of the split edit page.

What is the root cause of that problem?

  1. In src/libs/actions/SplitExpenses.ts (line 244), when the split flow is opened from Search/Spend, the base route is /search/split-expense-overview-search.
  2. On the Date tab, the nested active route is /search/split-expense-overview-search/date.
  3. When clicking a split row, onSelectRow in DynamicSplitExpensePage.tsx appends the dynamic route suffix SPLIT_EXPENSE_EDIT, creating: /search/split-expense-overview-search/date/split-expense/edit/<reportID>/<transactionID>
  4. In src/libs/Navigation/linkingConfig/OldRoutes.ts (line 222), a legacy wildcard rewrite rule exists:
    '/*/*/date/*/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4&reportActionID=$5',
    
    Because the URL has date as its third segment ($1 = search, $2 = split-expense-overview-search, date), getMatchingNewRoute catches this URL and rewrites it to: /r/edit/expense-date?action=search&iouType=split-expense-overview-search&transactionID=split-expense&reportID=edit&reportActionID=<reportID>/<transactionID>
  5. Because reportID=edit does not exist, the navigation router fails and renders the <NotFoundPage />. This does not occur on the Amount or Percentage tabs because no legacy rule matches those segment names.

What changes do you think we should make in order to solve the problem?

In src/libs/Navigation/linkingConfig/OldRoutes.ts (line 222): Add an explicit pass-through rule for date/split-expense/edit right alongside the existing rule on line 224 (which already does this for participants/participants-details):

// src/libs/Navigation/linkingConfig/OldRoutes.ts
'/*/*/date/split-expense/edit/*': '/$1/$2/date/split-expense/edit/$3',
'/*/*/date/*/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4&reportActionID=$5',

Why this solution is optimal (KISS & Minimal Blast Radius): getMatchingNewRoute evaluates patterns by specificity and length (pattern.length > maxLength in getMatchingNewRoute.ts:62). The more specific pass-through rule takes precedence over the wildcard, preserving the valid Date split edit route untouched while maintaining full backwards compatibility for legacy expense-date URLs.

What alternative solutions did you explore? (Optional)

  • Modifying onSelectRow navigation paths: Rejected because changing the active route construction in DynamicSplitExpensePage.tsx alters the sub-tab navigation state across all expense types.
  • Removing the legacy rule entirely: Rejected because external deep links and bookmarks pointing to legacy expense-date URLs would break.

What automated tests can you add to prevent this from re-occurring?

Add unit tests in tests/unit/OldRoutesTest.ts:

it('should correctly preserve /search/split-expense-overview-search/date/split-expense/edit routes without redirecting to OldDot expense-date', () => {
    const testRoute = '/search/split-expense-overview-search/date/split-expense/edit/123/456';
    expect(getMatchingNewRoute(testRoute)).toBe(testRoute);
});

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01b60d704ba377be83

camesenin avatar Oct 27 '26 17:10 camesenin

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 27 '26 17:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a user selects an expense from Spend > Expenses, clicks More > Split, switches to the Date tab, and clicks on any split row, the <NotFoundPage /> ("Hmm... it's not here") error screen opens instead of the split edit page.


What is the root cause of that problem?

In src/pages/iou/DynamicSplitExpensePage.tsx:

  1. When selecting a split row to edit, onSelectRow (line 623) builds the dynamic navigation route by omitting the optional basePath argument in createDynamicRoute:
    // src/pages/iou/DynamicSplitExpensePage.tsx:623
    Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_EXPENSE_EDIT.getRoute(item.reportID ?? reportID, item.transactionID)));
    
  2. In src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute.ts (line 70), when basePath is omitted, it falls back to getActiveRoute():
    const routePath = basePath ?? getActiveRoute();
    return combinePathAndSuffix(routePath, dynamicRouteSuffixWithParams);
    
  3. When the user is on the Amount tab (/amount) or Percentage tab (/percentage), the active route is: /search/split-expense-overview-search/amount Appending the suffix produces: /search/split-expense-overview-search/amount/split-expense/edit/...
  4. But when the user switches to the Date tab, getActiveRoute() includes /date: /search/split-expense-overview-search/date Appending split-expense/edit/... produces: /search/split-expense-overview-search/date/split-expense/edit/:reportID/:editSplitExpenseTransactionID
  5. During route normalization in getMatchingNewRoute (src/libs/Navigation/helpers/getMatchingNewRoute.ts), the URL is evaluated against the legacy redirect map in src/libs/Navigation/linkingConfig/OldRoutes.ts.
  6. OldRoutes.ts line 222 defines a broad legacy pattern with 5 wildcards:
    '/*/*/date/*/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4&reportActionID=$5'
    
    Because the URL contains /date/, this legacy pattern inadvertently intercepts and mangles the split edit URL:
    • $1 = search
    • $2 = split-expense-overview-search
    • $3 = split-expense
    • $4 = edit
    • $5 = :reportID/:editSplitExpenseTransactionID
  7. The URL is rewritten to /r/edit/expense-date?..., which fails to match any valid report or screen, triggering the <NotFoundPage />.
  8. Furthermore, the active tab segment (/date, /amount, /percentage) should never be baked into the base path for child dynamic screens. Child screens of the overview (like split-expense/edit and split-expense-create-date-range) must be anchored directly to the overview route, just like handleDatePress and initSplitExpense intend.

What changes do you think we should make in order to solve the problem?

1. Anchor child dynamic routes in DynamicSplitExpensePage.tsx to the overview base path:

In src/pages/iou/DynamicSplitExpensePage.tsx, construct the base overview route without the active tab suffix so child navigation is deterministic regardless of the active tab:

// src/pages/iou/DynamicSplitExpensePage.tsx
const overviewBaseRoute = route.name === SCREENS.MONEY_REQUEST.DYNAMIC_SPLIT_EXPENSE_SEARCH
    ? createDynamicRoute(DYNAMIC_ROUTES.MONEY_REQUEST_SPLIT_EXPENSE_SEARCH.getRoute(reportID, transactionID))
    : createDynamicRoute(DYNAMIC_ROUTES.MONEY_REQUEST_SPLIT_EXPENSE.getRoute(reportID, transactionID));

const onSelectRow = (item: SplitListItemType) => {
    if (!item.isEditable) {
        showConfirmModal({
            title: translate('iou.splitExpenseCannotBeEditedModalTitle'),
            prompt: translate('iou.splitExpenseCannotBeEditedModalDescription'),
            confirmText: translate('common.buttonConfirm'),
            shouldShowCancelButton: false,
        });
        return;
    }
    KeyboardUtils.dismiss({
        afterTransition: () => {
            initDraftSplitExpenseDataForEdit(draftTransaction, item.transactionID, item.reportID ?? reportID);
            Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.SPLIT_EXPENSE_EDIT.getRoute(item.reportID ?? reportID, item.transactionID), overviewBaseRoute));
        },
    });
};

Apply the same overviewBaseRoute to handleDatePress (line 585) for total consistency:

const handleDatePress = () => {
    Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.MONEY_REQUEST_SPLIT_EXPENSE_CREATE_DATE_RANGE.path, overviewBaseRoute));
};

2. Scope the legacy /*/*/date/* patterns in OldRoutes.ts:

Legacy expense step routes were originally shaped as /<action>/<iouType>/date/... where action and iouType were valid enum values (e.g. create, edit, submit, split, etc.). To safeguard against future collisions with top-level navigation routes (like /search/...), ensure getMatchingNewRoute does not redirect paths that are already known dynamic routes or contain modern prefixes (split-expense-overview-search, split-expense).


What alternative solutions did you explore? (Optional)

  • Modifying only OldRoutes.ts: While adjusting regexes prevents the rewrite, leaving /date/ in the dynamic route hierarchy violates the navigation architecture by nesting the edit screen under a transient tab segment instead of the overview screen itself.
  • Passing backPath: backPath represents the parent screen before entering the split overview (e.g. Search Root or Report), whereas SPLIT_EXPENSE_EDIT must be nested under the split overview. Passing overviewBaseRoute is the correct hierarchical parent.

What automated tests can you add to prevent this from re-occurring?

Add a test in tests/unit/DynamicSplitExpensePageTest.tsx / tests/navigation/getMatchingNewRouteTest.ts:

it('does not rewrite split-expense edit route when navigated from Date tab', () => {
    const splitEditRoute = '/search/split-expense-overview-search/split-expense/edit/123/456';
    expect(getMatchingNewRoute(splitEditRoute)).toBe(undefined);
});

it('correctly constructs SPLIT_EXPENSE_EDIT dynamic route from Date tab without tab pollution', () => {
    const overviewRoute = createDynamicRoute(DYNAMIC_ROUTES.MONEY_REQUEST_SPLIT_EXPENSE_SEARCH.getRoute('123', '456'));
    const editRoute = createDynamicRoute(DYNAMIC_ROUTES.SPLIT_EXPENSE_EDIT.getRoute('123', '789'), overviewRoute);
    expect(editRoute).toBe('/search/split-expense-overview-search/split-expense/edit/123/789');
});

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01f7d7991785f2ee01

apoorv-xs avatar Oct 27 '26 18:10 apoorv-xs

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a split expense is opened from Spend (Search), switching to the Date tab and clicking any split row opens the Hmm... it's not here page instead of the split expense edit page (SplitExpenseEditPage).

What is the root cause of that problem?

  1. When viewing a split expense on SplitExpensePage (src/pages/iou/SplitExpensePage.tsx:554) or DynamicSplitExpensePage (src/pages/iou/DynamicSplitExpensePage.tsx:536), switching between the Amount, Percentage, and Date tabs calls:

    Navigation.setParams({splitType: tabName});
    

    Because SPLIT_EXPENSE / SPLIT_EXPENSE_SEARCH are configured in src/libs/Navigation/linkingConfig/config.ts with path: '.../split-expense-overview/:splitType?' and path: 'search/split-expense-overview-search/:splitType?', selecting the Date tab updates the active URL path to:

    • From a report: /r/<reportID>/split-expense-overview/<transactionID>/<splitTransactionID>/date (5 path segments before /date)
    • From Spend (Search): /search/split-expense-overview-search/date (2 path segments before /date)
  2. When the user clicks a split row on the Date tab, onSelectRow navigates to:

    createDynamicRoute(DYNAMIC_ROUTES.SPLIT_EXPENSE_EDIT.getRoute(reportID, item.transactionID, Navigation.getActiveRoute()))
    

    In src/libs/Navigation/helpers/dynamicRoutesUtils/createDynamicRoute.ts (lines 71–116), createDynamicRoute appends the dynamic suffix split-expense/edit/<reportID>/<transactionID> to the current active base path, producing:

    /search/split-expense-overview-search/date/split-expense/edit/<reportID>/<transactionID>?backTo=...
    

    and passes that path to getStateFromPath(pathWithParam).

  3. Inside src/libs/Navigation/helpers/getStateFromPath.ts (lines 28–55), getStateFromPath runs findMatchingNewRoute(normalizedPath) against OLD_ROUTES (src/libs/Navigation/linkingConfig/OldRoutes.ts) before React Navigation parses the route. In src/libs/Navigation/linkingConfig/OldRoutes.ts (lines 222–223), there are legacy wildcard redirects intended for old /:action/:iouType/date/:transactionID/:reportID/:reportActionID routes:

    '/*/*/date/*/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4&reportActionID=$5',
    '/*/*/date/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4',
    

    In findMatchingNewRoute, every * except the last becomes ([^/]+) and the last * becomes (.+). Because /search/split-expense-overview-search/date/split-expense/edit/<reportID>/<transactionID> has exactly 2 segments before /date/ ($1 = "search", $2 = "split-expense-overview-search"), it matches '/*/*/date/*/*/*' with:

    • $1 = "search"
    • $2 = "split-expense-overview-search"
    • $3 = "split-expense"
    • $4 = "edit"
    • $5 = "<reportID>/<transactionID>"

    findMatchingNewRoute rewrites the URL to:

    /r/edit/expense-date?action=search&iouType=split-expense-overview-search&transactionID=split-expense&reportID=edit&reportActionID=<reportID>/<transactionID>
    

    This routes to DynamicIOURequestStepDate with reportID="edit" and transactionID="split-expense", which fails FullPageNotFoundView validation and renders the Not here page!

  4. Broader impact in OldRoutes.ts: All of the /*/*/<step>/... patterns in src/libs/Navigation/linkingConfig/OldRoutes.ts (lines 193–226: category, report, tag, tax-amount, tax-rate, waypoint, attendees, confirmation, distance, distance-manual, distance-och, distance-rate, merchant, participants, subrate, time, time-rate, description, date, amount) use unconstrained /*/*/ for the first two segments, even though legacy IOU step URLs always had an IOUAction (create, edit, submit, categorize, share) as their first segment ($1) and never "search" or "r" or "settings".

What changes do you think we should make in order to solve the problem?

We should prevent findMatchingNewRoute in src/libs/Navigation/helpers/getStateFromPath.ts (or the /*/*/ entries in src/libs/Navigation/linkingConfig/OldRoutes.ts) from matching modern /search/... (or non-IOU-action) routes against legacy /*/*/<step>/... redirects:

  1. In src/libs/Navigation/linkingConfig/OldRoutes.ts / src/libs/Navigation/helpers/getStateFromPath.ts:

    • Either remove the obsolete /*/*/date/*/*/* and /*/*/date/*/* entries (if legacy MONEY_REQUEST_STEP_DATE deep links are no longer used) or, to keep backward compatibility for all legacy /:action/:iouType/... deep links without ever hijacking /search/... or other 2-segment routes, restrict /*/*/ patterns in findMatchingNewRoute (src/libs/Navigation/helpers/getStateFromPath.ts) so that when a pattern starts with /*/*/, the first segment ($1) must be a valid CONST.IOU.ACTION (create | edit | submit | categorize | share):
    // In src/libs/Navigation/helpers/getStateFromPath.ts
    const IOU_ACTIONS_PATTERN = Object.values(CONST.IOU.ACTION).join('|');
    
    const compiledOldRoutes = Object.entries(OLD_ROUTES).map(([pattern, target]) => {
        let regexStr = pattern;
        const isLegacyIOURoute = regexStr.startsWith('/*/*/');
        if (isLegacyIOURoute) {
            regexStr = regexStr.slice(4); // strip leading '/*/*'
        }
        const parts = regexStr.split('*');
        const escaped = parts.map((part) => part.replaceAll(/[.*+?^${}()|[\]\\]/g, '\\$&'));
    
        let compiledBody: string;
        if (escaped.length === 1) {
            compiledBody = escaped[0];
        } else {
            const allButLast = escaped.slice(0, -1).join('([^/]+)');
            const last = escaped.at(-1);
            compiledBody = `${allButLast}(.+)${last}`;
        }
    
        const prefix = isLegacyIOURoute ? `/(${IOU_ACTIONS_PATTERN})/([^/]+)` : '';
        return {
            regex: new RegExp(`^${prefix}${compiledBody}$`),
            target,
        };
    });
    
    • This preserves every legacy /:action/:iouType/<step>/... redirect tested in tests/unit/Navigation/getStateFromPathTest.ts while ensuring /search/split-expense-overview-search/date/split-expense/edit/:reportID/:transactionID (and any future /search/<screen>/<tab>/... dynamic route) is never hijacked by OLD_ROUTES.
  2. Add a unit test in tests/unit/Navigation/getStateFromPathTest.ts:

    • Verify that /search/split-expense-overview-search/date/split-expense/edit/123/456 resolves to DYNAMIC_ROUTES.SPLIT_EXPENSE_EDIT. screen (SplitExpenseEdit_Root) and is not redirected to /r/edit/expense-date.

What alternative solutions did you explore? (Optional)

  • Removing Navigation.setParams({splitType: tabName}) from SplitExpensePage.tsx / DynamicSplitExpensePage.tsx was considered and rejected because splitType in the URL is intentionally used to preserve the active tab (amount, percentage, date) across navigation and browser refreshes.

huhuli083-creator avatar Oct 27 '26 19:10 huhuli083-creator

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01f7d7991785f2ee01

apoorv-xs avatar Oct 28 '26 00:10 apoorv-xs

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 28 '26 00:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When opening the split expense flow from Spend > Expenses (More > Split), switching to the Date tab, and clicking any split row, <NotFoundPage /> ("Hmm... it's not here") opens instead of the split edit page.

What is the root cause of that problem?

  1. When the split overview is opened from Spend > Expenses, the active route on the Date tab is /search/split-expense-overview-search/date.
  2. Clicking a split row in src/pages/iou/DynamicSplitExpensePage.tsx (lines 610-626) appends the dynamic SPLIT_EXPENSE_EDIT suffix via createDynamicRoute, navigating to: /search/split-expense-overview-search/date/split-expense/edit/<reportID>/<transactionID>
  3. Before normal route resolution, getMatchingNewRoute (src/libs/Navigation/helpers/getMatchingNewRoute.ts:47-76) matches the path against legacy redirects in src/libs/Navigation/linkingConfig/OldRoutes.ts.
  4. In src/libs/Navigation/linkingConfig/OldRoutes.ts (line 222), the wildcard rule:
    '/*/*/date/*/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4&reportActionID=$5',
    
    matches any path whose 3rd segment is date ($1 = search, $2 = split-expense-overview-search, date, $3 = split-expense, $4 = edit, $5 = <reportID>/<transactionID>) and rewrites it to: /r/edit/expense-date?action=search&iouType=split-expense-overview-search&transactionID=split-expense&reportID=edit&reportActionID=<reportID>/<transactionID> Because reportID=edit does not exist, <NotFoundPage /> is rendered.

What changes do you think we should make in order to solve the problem?

In src/libs/Navigation/linkingConfig/OldRoutes.ts (line 222), add an explicit pass-through entry for /*/*/date/split-expense/edit/* right alongside the existing /*/*/participants/participants-details/* pass-through on line 224:

--- a/src/libs/Navigation/linkingConfig/OldRoutes.ts
+++ b/src/libs/Navigation/linkingConfig/OldRoutes.ts
@@ -220,6 +220,7 @@ const oldRoutes: Record<string, string> = {
     '/*/*/description/*/*': '/r/$4/expense-description?action=$1&iouType=$2&transactionID=$3&reportID=$4',
     '/*/*/date/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4',
     '/*/*/date/*/*/*': '/r/$4/expense-date?action=$1&iouType=$2&transactionID=$3&reportID=$4&reportActionID=$5',
+    '/*/*/date/split-expense/edit/*': '/$1/$2/date/split-expense/edit/$3',
     '/*/*/participants/*/*': '/r/$4/participants?action=$1&iouType=$2&transactionID=$3&reportID=$4',
     '/*/*/participants/participants-details/*': '/$1/$2/participants/participants-details/$3',

Because getMatchingNewRoute selects the longest matching pattern (pattern.length > maxLength), '/*/*/date/split-expense/edit/*' takes precedence over '/*/*/date/*/*/*' and preserves the split edit URL (including any ?backTo= query string) while keeping legacy /*/*/date/*/* redirects intact.

What alternative solutions did you explore? (Optional)

  • Skipping oldRoutes in getMatchingNewRoute whenever a URL contains a known DYNAMIC_ROUTES suffix: while broader, adding the explicit pass-through in OldRoutes.ts follows the established pattern at line 224 with zero overhead on route matching.

Enes2553 avatar Oct 28 '26 17:10 Enes2553

@situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Oct 30 '26 21:10 melvin-bot[bot]

@situchan Friendly check-in on #105152. The route resolution fix (overviewBaseRoute) for the Date tab split row is fully tested and ready to PR whenever you get a chance to review.

apoorv-xs avatar Nov 01 '26 20:11 apoorv-xs

I think this is related to https://github.com/Expensify/App/issues/100874 cc @dmkt9 @roryabraham

mukhrr avatar Nov 03 '26 11:11 mukhrr

Not overdue

situchan avatar Nov 03 '26 11:11 situchan

Looks like #100874 is awaiting payment. Since this was created as a new issue with new assignment, I think we can fix this separately.

Edit: #100874 isn't relevant. That issue is about the background page switching to a Settings tab, which is a different mechanism.

situchan avatar Nov 03 '26 11:11 situchan

@MelvinBot implement this

situchan avatar Nov 03 '26 11:11 situchan

🤖 Draft PR created: Fix Not Here page when editing a split from the Date tab opened from Spend Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.

It adds a pass-through entry in OldRoutes.ts so the legacy date redirect no longer rewrites the Search split edit URL. A web test confirmed the split edit page now opens from the Date tab.

MelvinBot avatar Nov 03 '26 11:11 MelvinBot