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-09-03] [$75] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split #88213
When a split expense has one child moved to another report and that report is submitted, the "Edit Split → Remove split → Save" flow fails to navigate correctly because the reverse-split logic in updateSplitTransactionsFromSplitExpensesFlow doesn't account for this scenario.
The isReverseSplitOperation flag at line 165-166 requires hasEditableSplitExpensesLeft to be true. When the user removes the non-submitted split (the one still on Report 1), the only remaining split expense is the submitted one (on Report 2), so hasEditableSplitExpensesLeft evaluates to false — because its statusNum >= SUBMITTED (set via initSplitExpenseItemData at line 100).
With isReverseSplitOperation = false, two things break:
No deleteTransactionNavigateBackUrl is set (line 1372), so the ReportNotFoundGuard suppression mechanism is not armed.
Even if the user removes the submitted split instead (keeping the non-submitted one, making isReverseSplitOperation = true), the reverse split API call (REVERT_SPLIT_TRANSACTION) must reconcile a child that now lives on a different, submitted report — a case the reverse split was not designed for. This can also produce unexpected navigation or data states.
What changes do you think we should make in order to solve the problem?
Broaden the isReverseSplitOperation detection to also handle the case where splitExpenses.length === 1 and the remaining split is on a submitted report (i.e., remove the hasEditableSplitExpensesLeft requirement, or add an alternative condition for this specific "moved + submitted child" scenario).
Ensure setDeleteTransactionNavigateBackUrl is called before any optimistic report deletion whenever a reverse split will delete the expense report — regardless of whether the remaining split is editable.
Ensure the navigation path at lines 1410-1423 (navigateBackOnDeleteTransaction) is taken when the expense report is being deleted, falling back to the chat report via fallbackReportID.
What alternative solutions did you explore? (Optional)
An alternative would be to prevent the "Remove split" action entirely when one child has been moved to a submitted report (since reverting the split is not cleanly possible in that state). However, this would reduce functionality — the proper fix is to handle the navigation correctly so users land on a valid page after the operation.
Supporting evidence and related issues
Draft initialization: When "Edit Split" is opened, initSplitExpense builds splitExpenses from ALL child transactions (including the moved one), each with statusNum from its report (SplitExpenseItems.ts:100).
Report deletion: The expense report is optimistically deleted at SplitTransactionUpdate.ts:1190-1214 when isLastTransactionInReport is true.
"Not here" trigger:ReportNotFoundGuard.tsx:29-104 shows the not-found page when !deleteTransactionNavigateBackUrl && !isLoading && !reportExists.
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] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/-][+][$250] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/+]on May 13, 2026
Please re-state the problem that we are trying to solve in this issue.
After splitting an expense into two children, moving one child to a different report, submitting that other report, opening the remaining child on the original report, clicking More → Edit Split → Remove split and saving, the app navigates to a "Not Here" page instead of reverting the expense back to a single regular expense on the original report.
What is the root cause of that problem?
The edit-split save flow for this pathway is updateSplitTransactionsFromSplitExpensesFlow in src/libs/actions/IOU/Split.ts. Before invoking the backend it inspects the pending change to decide whether the operation will empty the expense report. Today that check is gated on isReverseSplitOperation:
isReverseSplitOperation additionally requires hasEditableSplitExpensesLeft, which checks that the remaining split's report has a status below SUBMITTED:
In the reported scenario the only remaining split (the one that was moved earlier) now lives on the submitted other report, so hasEditableSplitExpensesLeft is false and the operation falls through the UPDATE_SPLIT_TRANSACTION path instead of the revert path. However the optimistic data still removes the child being deleted on the current expense report — and because the sibling was previously moved out, that child was the only transaction left on the current expense report. The expense report therefore becomes empty optimistically.
Because the guard only protects the reverse-split branch, setDeleteTransactionNavigateBackUrl is never called, and navigation falls through to dismissModalWithReport targeting the now-empty expense report:
What changes do you think we should make in order to solve the problem?
Broaden the condition in updateSplitTransactionsFromSplitExpensesFlow so the pre-save and post-save branches recognise any operation that will leave the expense report empty, not only the reverse-split shape.
Replace the current isLastTransactionInReport computation with a single predicate that asks: "will the expense report have zero transactions after this update?". That is true in exactly two cases:
The existing reverse-split path, which deletes all children.
The regular update path, when the expense report currently holds a single transaction and none of the remaining splits live on that report (so the sole remaining child on that report is being removed).
When the predicate is true, behave the same way the reverse-split branch does today: call setDeleteTransactionNavigateBackUrl with the fallback chat/parent report before updateSplitTransactions runs so ReportNotFoundGuard suppresses the "Not Here" page during the transition, and after the update use navigateBackOnDeleteTransaction with that same fallback route instead of dismissModalWithReport so the stale expense-report screen is popped from the stack rather than re-entered.
The mutation itself does not need to change — the fix is scoped to navigation. The new predicate subsumes the existing reverse-split case (when isReverseSplitOperation is true, the conjunction reduces to the current check), so behaviour is preserved for all flows that already worked.
What alternative solutions did you explore? (Optional)
Disabling the Remove split button on the remaining editable split when all sibling splits live on non-editable reports would sidestep the navigation bug, but it silently blocks a legitimate user intent (ending up with a single expense on the current report) without explanation and would leave the underlying navigation gap for any future caller that reaches the same code path. Handling the empty-expense-report case at the navigation layer keeps the fix small and centralised where the optimistic deletion is produced.
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
⚠️@neerajbachani Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).
Please re-state the problem that we are trying to solve in this issue.
When a user splits an expense into two children, moves one child to another report and submits it, then opens the remaining split in the original report and removes it via More > Edit Split > Remove split, the "Hmm... it's not here" page appears instead of the split reverting to a regular expense. This occurs because the remaining split lives on a submitted report, so the code fails to set up the fallback navigation before optimistically deleting the only transaction on the original expense report, leaving that report empty with no guard to redirect the user.
What is the root cause of that problem?
The guard that arms setDeleteTransactionNavigateBackUrl in src/libs/actions/IOU/SplitTransactionUpdate.ts:1365–1374 is gated on isReverseSplitOperation, which requires hasEditableSplitExpensesLeft — meaning at least one remaining split must have statusNum < SUBMITTED. In the repro scenario, the only remaining split is on a submitted report (submitted in step 5), so hasEditableSplitExpensesLeft is false, isReverseSplitOperation is false, and the guard never fires. The code still optimistically removes the transaction from the original expense report (emptying it), but falls through to Navigation.dismissModalWithReport({reportID: targetReportID}) targeting the now-empty report, triggering ReportNotFoundGuard to render the 'Not here' page.
The fix recognizes that emptying the expense report can happen in two paths: the existing reverse-split case (both splits editable) and the moved-child case (sibling on a submitted report). Both require fallback navigation.
What changes do you think we should make in order to solve the problem?
File:src/libs/actions/IOU/SplitTransactionUpdate.ts Function:updateSplitTransactionsFromSplitExpensesFlow Description: Replace the isReverseSplitOperation-only guard with a broader willEmptyExpenseReport check. Add logic to detect when the removal will leave the expense report with no remaining splits (regardless of whether those splits are editable), then set the fallback navigation route:
expenseReportID is null-guarded before any array operations; when it is absent both derived arrays default to empty so willEmptyExpenseReport is always false, preventing a runtime error.
splitExpenses.filter guards each element with expense?. to tolerate sparse or partially-loaded data in the array.
fallbackReportID is tested with !!fallbackReportID inside the if condition, so navigation is only set when a concrete target report exists. If both chatReportID and parentReportID are absent the block is skipped and the existing fallback path (whatever Navigation.dismissModalWithReport resolves to) remains in effect, which is the same behavior as today.
setDeleteTransactionNavigateBackUrl writes a route string consumed by the shared navigation layer (Navigation.goBack / Navigation.dismissModalWithReport), which already dispatches to the correct stack entry for both web (history-based) and mobile (React Navigation modal stack). No platform-specific branching is needed here because that dispatch is handled downstream inside the navigation utility itself.
This change widens the predicate to cover both the existing reverse-split path (where all remaining splits are editable) and the new moved-child path (where the sibling is on a submitted report).
Blast radius: Scope verified in the combined S2/S3 pass. Only updateSplitTransactionsFromSplitExpensesFlow is modified; no other callers are affected.
What alternative solutions did you explore? (Optional)
changed the title [-][$250] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/-][+][$75] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/+]on Sep 2, 2026
changed the title [-][$75] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/-][+][Due for payment 2026-09-03] [$75] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/+]on Sep 3, 2026
@mallenexpensify I used to put the tests in a different comment back then. After your suggestion, I have started including them in the Reviewers checklist.
Activity
MelvinBot commentedon May 13, 2026
Proposal
What is the root cause of that problem?
When a split expense has one child moved to another report and that report is submitted, the "Edit Split → Remove split → Save" flow fails to navigate correctly because the reverse-split logic in
updateSplitTransactionsFromSplitExpensesFlowdoesn't account for this scenario.The
isReverseSplitOperationflag at line 165-166 requireshasEditableSplitExpensesLeftto betrue. When the user removes the non-submitted split (the one still on Report 1), the only remaining split expense is the submitted one (on Report 2), sohasEditableSplitExpensesLeftevaluates tofalse— because itsstatusNum >= SUBMITTED(set viainitSplitExpenseItemDataat line 100).With
isReverseSplitOperation = false, two things break:deleteTransactionNavigateBackUrlis set (line 1372), so theReportNotFoundGuardsuppression mechanism is not armed.dismissModalWithReport({reportID: targetReportID}), which navigates to the expense report that is being optimistically deleted — triggering the "Hmm... it's not here" page viaReportNotFoundGuard.Even if the user removes the submitted split instead (keeping the non-submitted one, making
isReverseSplitOperation = true), the reverse split API call (REVERT_SPLIT_TRANSACTION) must reconcile a child that now lives on a different, submitted report — a case the reverse split was not designed for. This can also produce unexpected navigation or data states.What changes do you think we should make in order to solve the problem?
The fix should be in
updateSplitTransactionsFromSplitExpensesFlow(and potentiallyupdateSplitTransactions):isReverseSplitOperationdetection to also handle the case wheresplitExpenses.length === 1and the remaining split is on a submitted report (i.e., remove thehasEditableSplitExpensesLeftrequirement, or add an alternative condition for this specific "moved + submitted child" scenario).setDeleteTransactionNavigateBackUrlis called before any optimistic report deletion whenever a reverse split will delete the expense report — regardless of whether the remaining split is editable.navigateBackOnDeleteTransaction) is taken when the expense report is being deleted, falling back to the chat report viafallbackReportID.What alternative solutions did you explore? (Optional)
An alternative would be to prevent the "Remove split" action entirely when one child has been moved to a submitted report (since reverting the split is not cleanly possible in that state). However, this would reduce functionality — the proper fix is to handle the navigation correctly so users land on a valid page after the operation.
Supporting evidence and related issues
Draft initialization: When "Edit Split" is opened,
initSplitExpensebuildssplitExpensesfrom ALL child transactions (including the moved one), each withstatusNumfrom its report (SplitExpenseItems.ts:100).Report deletion: The expense report is optimistically deleted at
SplitTransactionUpdate.ts:1190-1214whenisLastTransactionInReportis true."Not here" trigger:
ReportNotFoundGuard.tsx:29-104shows the not-found page when!deleteTransactionNavigateBackUrl && !isLoading && !reportExists.Likely related issues:
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 - @sobitneupane (
External)[-][Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/-][+][$250] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/+]melvin-bot commentedon May 13, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022054388487345779952
wildan-m commentedon May 13, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
After splitting an expense into two children, moving one child to a different report, submitting that other report, opening the remaining child on the original report, clicking More → Edit Split → Remove split and saving, the app navigates to a "Not Here" page instead of reverting the expense back to a single regular expense on the original report.
What is the root cause of that problem?
The edit-split save flow for this pathway is
updateSplitTransactionsFromSplitExpensesFlowinsrc/libs/actions/IOU/Split.ts. Before invoking the backend it inspects the pending change to decide whether the operation will empty the expense report. Today that check is gated onisReverseSplitOperation:App/src/libs/actions/IOU/Split.ts
Lines 2231 to 2240 in 7c6e4e8
isReverseSplitOperationadditionally requireshasEditableSplitExpensesLeft, which checks that the remaining split's report has a status belowSUBMITTED:App/src/libs/actions/IOU/Split.ts
Lines 1126 to 1129 in 7c6e4e8
In the reported scenario the only remaining split (the one that was moved earlier) now lives on the submitted other report, so
hasEditableSplitExpensesLeftisfalseand the operation falls through theUPDATE_SPLIT_TRANSACTIONpath instead of the revert path. However the optimistic data still removes the child being deleted on the current expense report — and because the sibling was previously moved out, that child was the only transaction left on the current expense report. The expense report therefore becomes empty optimistically.Because the guard only protects the reverse-split branch,
setDeleteTransactionNavigateBackUrlis never called, and navigation falls through todismissModalWithReporttargeting the now-empty expense report:App/src/libs/actions/IOU/Split.ts
Lines 2291 to 2296 in 7c6e4e8
ReportNotFoundGuardthen sees!deleteTransactionNavigateBackUrl && !reportExistsand renders the "Not Here" page:App/src/pages/inbox/ReportNotFoundGuard.tsx
Lines 47 to 54 in 7c6e4e8
What changes do you think we should make in order to solve the problem?
Broaden the condition in
updateSplitTransactionsFromSplitExpensesFlowso the pre-save and post-save branches recognise any operation that will leave the expense report empty, not only the reverse-split shape.Replace the current
isLastTransactionInReportcomputation with a single predicate that asks: "will the expense report have zero transactions after this update?". That is true in exactly two cases:When the predicate is true, behave the same way the reverse-split branch does today: call
setDeleteTransactionNavigateBackUrlwith the fallback chat/parent report beforeupdateSplitTransactionsruns soReportNotFoundGuardsuppresses the "Not Here" page during the transition, and after the update usenavigateBackOnDeleteTransactionwith that same fallback route instead ofdismissModalWithReportso the stale expense-report screen is popped from the stack rather than re-entered.The mutation itself does not need to change — the fix is scoped to navigation. The new predicate subsumes the existing reverse-split case (when
isReverseSplitOperationis true, the conjunction reduces to the current check), so behaviour is preserved for all flows that already worked.Compare branch:
https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/88213-split-notfound-after-remove?expand=1
What alternative solutions did you explore? (Optional)
Disabling the Remove split button on the remaining editable split when all sibling splits live on non-editable reports would sidestep the navigation bug, but it silently blocks a legitimate user intent (ending up with a single expense on the current report) without explanation and would leave the underlying navigation gap for any future caller that reaches the same code path. Handling the empty-expense-report case at the navigation layer keeps the fix small and centralised where the optimistic deletion is produced.
neerajbachani commentedon May 13, 2026
Proposal
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
github-actions commentedon May 13, 2026
aswin-s commentedon May 13, 2026
Please re-state the problem that we are trying to solve in this issue.
When a user splits an expense into two children, moves one child to another report and submits it, then opens the remaining split in the original report and removes it via More > Edit Split > Remove split, the "Hmm... it's not here" page appears instead of the split reverting to a regular expense. This occurs because the remaining split lives on a submitted report, so the code fails to set up the fallback navigation before optimistically deleting the only transaction on the original expense report, leaving that report empty with no guard to redirect the user.
What is the root cause of that problem?
The guard that arms
setDeleteTransactionNavigateBackUrlinsrc/libs/actions/IOU/SplitTransactionUpdate.ts:1365–1374is gated onisReverseSplitOperation, which requireshasEditableSplitExpensesLeft— meaning at least one remaining split must havestatusNum < SUBMITTED. In the repro scenario, the only remaining split is on a submitted report (submitted in step 5), sohasEditableSplitExpensesLeftis false,isReverseSplitOperationis false, and the guard never fires. The code still optimistically removes the transaction from the original expense report (emptying it), but falls through toNavigation.dismissModalWithReport({reportID: targetReportID})targeting the now-empty report, triggering ReportNotFoundGuard to render the 'Not here' page.App/src/libs/actions/IOU/SplitTransactionUpdate.ts
Lines 1365 to 1374 in d6a8779
The fix recognizes that emptying the expense report can happen in two paths: the existing reverse-split case (both splits editable) and the moved-child case (sibling on a submitted report). Both require fallback navigation.
What changes do you think we should make in order to solve the problem?
File:
src/libs/actions/IOU/SplitTransactionUpdate.tsFunction:
updateSplitTransactionsFromSplitExpensesFlowDescription: Replace the
isReverseSplitOperation-only guard with a broaderwillEmptyExpenseReportcheck. Add logic to detect when the removal will leave the expense report with no remaining splits (regardless of whether those splits are editable), then set the fallback navigation route:Key points:
expenseReportIDis null-guarded before any array operations; when it is absent both derived arrays default to empty sowillEmptyExpenseReportis alwaysfalse, preventing a runtime error.splitExpenses.filterguards each element withexpense?.to tolerate sparse or partially-loaded data in the array.fallbackReportIDis tested with!!fallbackReportIDinside theifcondition, so navigation is only set when a concrete target report exists. If bothchatReportIDandparentReportIDare absent the block is skipped and the existing fallback path (whateverNavigation.dismissModalWithReportresolves to) remains in effect, which is the same behavior as today.setDeleteTransactionNavigateBackUrlwrites a route string consumed by the shared navigation layer (Navigation.goBack/Navigation.dismissModalWithReport), which already dispatches to the correct stack entry for both web (history-based) and mobile (React Navigation modal stack). No platform-specific branching is needed here because that dispatch is handled downstream inside the navigation utility itself.This change widens the predicate to cover both the existing reverse-split path (where all remaining splits are editable) and the new moved-child path (where the sibling is on a submitted report).
Blast radius: Scope verified in the combined S2/S3 pass. Only
updateSplitTransactionsFromSplitExpensesFlowis modified; no other callers are affected.What alternative solutions did you explore? (Optional)
N/A
25 remaining items
chuckdries commentedon Sep 2, 2026
Oh my gosh sorry for the radio silence! Let's do a partial payout because the PR made it so far through the process
[-][$250] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/-][+][$75] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/+]melvin-bot commentedon Sep 2, 2026
[-][$75] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/-][+][Due for payment 2026-09-03] [$75] [Exploratory] 26W16 - Web - Split - Not here page appear after submit one split and remove the other split[/+]melvin-bot commentedon Sep 3, 2026
Current assignee @mallenexpensify is eligible for the Awaiting Payment assigner, not assigning anyone new.
mallenexpensify commentedon Sep 3, 2026
Payment Summary
Contributor+: @sobitneupane due $250 via NewDot
No tests on reviewers checklist so $125
sobitneupane commentedon Sep 4, 2026
@mallenexpensify I used to put the tests in a different comment back then. After your suggestion, I have started including them in the Reviewers checklist.
mallenexpensify commentedon Sep 4, 2026
Thx @sobitneupane confirming tests and price bump above
JmillsExpensify commentedon Sep 18, 2026
$250 approved for @sobitneupane