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
Split - Error when editing expense to higher amount after removing split from report #91481
Version Number: 9.3.80-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#91104 Email or phone of affected tester (no customers):isjdosdjoijosdjosnj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create an expense with amount 10.00.
Open the expense.
Click More > Split > Save.
Open any split.
Click Report > Remove from report.
Click Amount.
Change the amount to 10.00.
Click Amount again.
Change the amount to 11.00.
Expected Result:
User can edit the expense to higher amount because the split is reverted (no more split label on the amount title).
Actual Result:
Error shows up when editing expense to higher amount after removing split from report.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
PR #91104 introduced useHasMultipleSplitChildren, which counts all child transactions matching originalTransactionID — including orphaned ones (reportID = '0', i.e. removed from report). The old code excluded unreported children from this count.
When you "Remove from report" on a split child, changeTransactionsReport sets the child's reportID to '0' but preservescomment.originalTransactionID and comment.source = 'split'. Because the new hook still counts this orphaned child (via child.isSplitSource being true), hasMultipleSplitChildren remains true. This keeps the split indicator visible and routes amount edits through the SplitExpensePage, where computeSplitSaveErrorMessage rejects any amount exceeding the parent's original $10.
What changes do you think we should make in order to solve the problem?
Filter out unreported (orphaned) children in selectChildTransactionInfo at useHasMultipleSplitChildren.ts:18. Add a check that t?.reportID !== CONST.REPORT.UNREPORTED_REPORT_ID to the filter condition, so removed-from-report children are no longer counted toward hasMultipleSplitChildren. This restores the pre-PR behavior where removing a split child effectively "unsplits" the remaining transaction from the UI's perspective.
This is the minimal fix that addresses the regression without affecting PR #91104's original goal (allowing re-split after sibling deletion), because the re-split flow uses getChildTransactions with includeOrphaned=true separately.
What alternative solutions did you explore? (Optional)
Clearing split metadata (comment.originalTransactionID, comment.source) in changeTransactionsReport when moving to unreported was considered, but that would affect backend state and could break the re-split flow that PR #91104 was fixing.
Investigation details
Data flow:
User creates $10 expense → splits into 2 children ($5 each)
"Remove from report" on one child → changeTransactionsReport sets reportID = '0' but preserves split metadata
useHasMultipleSplitChildren still counts the orphaned child (via isSplitSource = true) → hasMultipleSplitChildren = true
Split indicator stays visible → amount edit routes to SplitExpensePage
Possibly related:#91105 (unable to split a reverted split transaction after deleting the unreported split transaction) — same area of code affected by PR #91104.
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.
@trjExpensify I'd like your product perspective on this, to see if you confirm or not my reasoning
Imagine we have a report with 2 expenses (Expense A, Expense B).
Expense A is split into two (split A, split B).
Split B is removed from the workspace's report and moved back to selfDM -> hence, in theory, a revert split scenario. However, since it isn't the Edit Splits menu that is shown when we move an expense to another report, the RevertSplitTransaction API isn't called; instead, the ChangeTransactionsReport flow is.
The result: the link between the two expenses remains intact.
As a result, we can't give the split expense A in the workspace chat an amount higher than the original split (as it still thinks it must equal split A + split B).
Here is my suggested fix:
When a split child is moved to selfDM via the report transactions flow, and 1 reported split child remains, we clear the split markers. If two or more reported splits are present, we keep the split markers so the remaining reported splits can still be managed normally.
Split B is removed from the workspace's report and moved back to selfDM -> hence, in theory, a revert split scenario.
Is this the intended product behaviour from inception? In other words, if you unreport an expense the "split link" is removed and the amount is reverted to whatever it was originally?
Is this the intended product behaviour from inception? In other words, if you unreport an expense the "split link" is removed and the amount is reverted to whatever it was originally?
It's not technically when you unreport any expense that the split link would be removed, but only if we have 2 expenses and we unreport one of them.
I think the split should still remain after one of the expenses is unreported. Think this falls under the umbrella of updating Splits for unreported expenses, though. So the bug here imo is that we revert the split when you move one of the splits off the report. So far as I can tell, that will get fixed in #84382
Alright, then the present issue "Error when editing expense to higher amount after removing split from report" will still remain, even after #84382.
Are we good to close this then if it's the expected result? cc @trjExpensify@garrettmknight:
"Error shows up when editing expense to higher amount after removing split from report to selfDM".
Alright, then the present issue "Error when editing expense to higher amount after removing split from report" will still remain, even after #84382.
In the OP the error is "Unexpected error editing this expense. Please try again later.” - that should be more pointed if it does truly remain after #84382. But why would it? Wouldn't going to edit the amount re-open the edit split dialogue?
My bad, I explained myself poorly, you're right @trjExpensify. Instead of an unexpected error, we'll see this (with one split reported, one split unreported and an amount higher than the 2 splits):
I guess this is fine, as there are no API errors anymore and the Edit Splits section is opened. Closing the issue since it'll be solved by #84382
Activity
applause-bot commentedon May 22, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/2008d033bf1365bffbaa96c733f79924e3286d1499d1cc1f02baf840816ee27d
melvin-bot commentedon May 22, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #91104
melvin-bot commentedon May 22, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 22, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
MelvinBot commentedon May 23, 2026
Proposal
What is the root cause of that problem?
PR #91104 introduced
useHasMultipleSplitChildren, which counts all child transactions matchingoriginalTransactionID— including orphaned ones (reportID ='0', i.e. removed from report). The old code excluded unreported children from this count.When you "Remove from report" on a split child,
changeTransactionsReportsets the child'sreportIDto'0'but preservescomment.originalTransactionIDandcomment.source = 'split'. Because the new hook still counts this orphaned child (viachild.isSplitSourcebeing true),hasMultipleSplitChildrenremainstrue. This keeps the split indicator visible and routes amount edits through theSplitExpensePage, wherecomputeSplitSaveErrorMessagerejects any amount exceeding the parent's original $10.What changes do you think we should make in order to solve the problem?
Filter out unreported (orphaned) children in
selectChildTransactionInfoatuseHasMultipleSplitChildren.ts:18. Add a check thatt?.reportID !== CONST.REPORT.UNREPORTED_REPORT_IDto the filter condition, so removed-from-report children are no longer counted towardhasMultipleSplitChildren. This restores the pre-PR behavior where removing a split child effectively "unsplits" the remaining transaction from the UI's perspective.This is the minimal fix that addresses the regression without affecting PR #91104's original goal (allowing re-split after sibling deletion), because the re-split flow uses
getChildTransactionswithincludeOrphaned=trueseparately.What alternative solutions did you explore? (Optional)
Clearing split metadata (
comment.originalTransactionID,comment.source) inchangeTransactionsReportwhen moving to unreported was considered, but that would affect backend state and could break the re-split flow that PR #91104 was fixing.Investigation details
Data flow:
changeTransactionsReportsetsreportID = '0'but preserves split metadatauseHasMultipleSplitChildrenstill counts the orphaned child (viaisSplitSource = true) →hasMultipleSplitChildren = trueSplitExpensePagecomputeSplitSaveErrorMessagecompares child amount ($11) against parent amount ($10) → error'iou.totalAmountGreaterThanOriginal'Key code locations:
useHasMultipleSplitChildren.ts:18— missing UNREPORTED filteruseHasMultipleSplitChildren.ts:31— counts orphaned children viaisSplitSourceTransaction.ts:1090— preserves split metadata on remove-from-reportSplitExpenseUtils.ts:90-100— amount validation that triggers the errorPossibly related: #91105 (unable to split a reverted split transaction after deleting the unreported split transaction) — same area of code affected by PR #91104.
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.mountiny commentedon May 24, 2026
@MelvinBot poease raise a straight revert of the offending #91104
MelvinBot commentedon May 24, 2026
🤖 Draft revert PR created: #91549
This is a straight revert of #91104. Please mark it as "Ready for review" when it is ready for review.
5 remaining items
mountiny commentedon May 25, 2026
Thanks @lakchote
lakchote commentedon May 25, 2026
@trjExpensify I'd like your product perspective on this, to see if you confirm or not my reasoning
Imagine we have a report with 2 expenses (Expense A, Expense B).
Expense A is split into two (split A, split B).
Split B is removed from the workspace's report and moved back to selfDM -> hence, in theory, a revert split scenario. However, since it isn't the Edit Splits menu that is shown when we move an expense to another report, the
RevertSplitTransactionAPI isn't called; instead, theChangeTransactionsReportflow is.The result: the link between the two expenses remains intact.
As a result, we can't give the split expense A in the workspace chat an amount higher than the original split (as it still thinks it must equal split A + split B).
Here is my suggested fix:
When a split child is moved to selfDM via the report transactions flow, and 1 reported split child remains, we clear the split markers. If two or more reported splits are present, we keep the split markers so the remaining reported splits can still be managed normally.
--
If you agree, I have a backend PR to fix this
trjExpensify commentedon May 26, 2026
Is this the intended product behaviour from inception? In other words, if you unreport an expense the "split link" is removed and the amount is reverted to whatever it was originally?
CC: @garrettmknight on this as well btw.
lakchote commentedon May 26, 2026
It's not technically when you unreport any expense that the split link would be removed, but only if we have 2 expenses and we unreport one of them.
garrettmknight commentedon May 26, 2026
I think the split should still remain after one of the expenses is unreported. Think this falls under the umbrella of updating Splits for unreported expenses, though. So the bug here imo is that we revert the split when you move one of the splits off the report. So far as I can tell, that will get fixed in #84382
trjExpensify commentedon May 26, 2026
I agree with Garrett. 👍
lakchote commentedon May 26, 2026
Alright, then the present issue "Error when editing expense to higher amount after removing split from report" will still remain, even after #84382.
Are we good to close this then if it's the expected result? cc @trjExpensify @garrettmknight:
"Error shows up when editing expense to higher amount after removing split from report to selfDM".
trjExpensify commentedon May 26, 2026
In the OP the error is "Unexpected error editing this expense. Please try again later.” - that should be more pointed if it does truly remain after #84382. But why would it? Wouldn't going to edit the amount re-open the edit split dialogue?
lakchote commentedon May 26, 2026
My bad, I explained myself poorly, you're right @trjExpensify. Instead of an unexpected error, we'll see this (with one split reported, one split unreported and an amount higher than the 2 splits):
I guess this is fine, as there are no API errors anymore and the Edit Splits section is opened. Closing the issue since it'll be solved by #84382
Thank you both for your input Garrett and Tom!
trjExpensify commentedon May 26, 2026
Sounds good, thanks for the ping!