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-10-21] Split - Approved, Paid and/or Done expense amounts are changed if the last split is in Draft and removed #99190
Click on arrow of the split allows editing > Remove split > Save
Expected Result:
Cash expenses
Removing a split should succeed, including when another split is already approved or paid.
Approved/paid splits are frozen: their amounts must not change, and the removed amount is not redistributed onto them.
Instead, the original (parent) expense amount drops to match the remaining split total.
This should also work when the actor is the submitter, not just an admin.
Company card expenses
The Remove Split button shouldn't show when all other splits have been approved, paid or marked as done.
No new backend work needed: once the frontend stops redistributing, the existing exact-sum check rejects the removal on its own.
Actual Result:
After removing split expense, the paid split expense is reverted. The message "change amount to new amount (previously amount)" is displayed under the mark as paid message
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
The "Edit splits → Remove split → Save" flow has no guard against removing a split whose counterpart expense is already approved/paid — the only thing stopping it is a UI permission gate that admins bypass.
Whether a split row exposes the edit/remove arrow is decided by isSplitAction(). When the split's counterpart report is no longer open (i.e. already approved/paid), it returns:
An employee/submitter fails both submitter conditions (isAwaitingFirstLevelApproval is false once approved/paid), so the arrow is hidden and they get the "cannot be edited" modal → removal is blocked.
A policy admin passes via the || isAdmin short-circuit → the destructive "Remove split" action is exposed.
Once the admin reaches Save, nothing else stops them: removeSplitExpenseField, onSaveSplitExpense and its computeSplitSaveErrorMessage validate only split count / amounts — none of them check isReportApproved / isSettled. So the app fires the revert and the already-paid expense reverts, producing the "changed amount to X (previously Y)" message under the mark-as-paid message.
What changes do you think we should make in order to solve the problem?
Add an approved/paid guard on the removal itself, independent of the admin role, so a split cannot be removed (or absorbed into) when its counterpart expense is approved or settled.
Concretely: in isSplitExpenseEditable (DynamicSplitExpensePage.tsx:161-179) — and/or the Save path in onSaveSplitExpense — treat a split whose report is isReportApproved / isSettled as non-removable regardless of isAdmin, and surface the same blocking error the employee already sees. isReportApproved/isSettled are already imported and computed in this file (used only for the header label today at lines 479-497), so the state is readily available.
This makes the admin path behave like the employee path (error shown, no revert), matching the Expected Result.
Investigation details & evidence
Data flow (admin repro):
Expense split into 2 children; one child is moved to a new report and approved/paid.
Admin opens the draft → More > Edit splits (DynamicSplitExpensePage). Each row's isEditable = isSplitExpenseEditable(item) → isSplitAction(...) evaluated against that split's own (approved/paid) report.
isSplitAction reaches the non-open branch and returns true for the admin via || isAdmin → arrow shown (SplitListItem.tsx:221-235).
Remove split → removeSplitExpenseField filters the split out and redistributes the total — no approved/paid check.
Save → onSaveSplitExpense → reverse-split path in SplitTransactionUpdate.ts (isReverseSplitOperation keys off statusNum, not approved/paid state) → API revert fires → paid expense reverts.
Why the employee correctly errors: the employee never gets past step 3 (arrow hidden, "cannot be edited" modal). The blocking error footer they'd otherwise see is surfaced from the backend onto draftTransaction.errors (DynamicSplitExpensePage.tsx:288-294) via iou.error.genericEditFailureMessage.
Alternative explanation considered: a backend authorization difference (admins allowed to modify settled expenses) likely also contributes — this would need an internal investigation of the split/revert backend command, which lives outside the App repo. Regardless of the backend, the App should not expose or execute the removal of an approved/paid split, so the frontend guard above is the right fix within App.
Confidence: High for the App-side root cause (frontend gate + missing approved/paid guard, both verified in code). Two independent code investigations converged on the same mechanism.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/99190) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
@mallenexpensify this one's due now, #100281 hit production on Oct 13. The deploy blocker #103791 wasn't caused by it, the same bug happens on production without it.
changed the title [-]Split - Approved, Paid and/or Done expense amounts are changed if the last split is in Draft and removed[/-][+][Due for payment 2026-10-21] Split - Approved, Paid and/or Done expense amounts are changed if the last split is in Draft and removed[/+]on Oct 21, 2026
53. @dmkt9 apologies, there's been a Chrome +TextExpander bug recently. can you please accept the job below? Please reply here and tag me once you have.
Activity
MelvinBot commentedon Aug 21, 2026
Proposal
What is the root cause of that problem?
The "Edit splits → Remove split → Save" flow has no guard against removing a split whose counterpart expense is already approved/paid — the only thing stopping it is a UI permission gate that admins bypass.
Whether a split row exposes the edit/remove arrow is decided by
isSplitAction(). When the split's counterpart report is no longer open (i.e. already approved/paid), it returns:src/libs/ReportSecondaryActionUtils.ts:190isAwaitingFirstLevelApprovalisfalseonce approved/paid), so the arrow is hidden and they get the "cannot be edited" modal → removal is blocked.|| isAdminshort-circuit → the destructive "Remove split" action is exposed.Once the admin reaches Save, nothing else stops them:
removeSplitExpenseField,onSaveSplitExpenseand itscomputeSplitSaveErrorMessagevalidate only split count / amounts — none of them checkisReportApproved/isSettled. So the app fires the revert and the already-paid expense reverts, producing the "changed amount to X (previously Y)" message under the mark-as-paid message.What changes do you think we should make in order to solve the problem?
Add an approved/paid guard on the removal itself, independent of the admin role, so a split cannot be removed (or absorbed into) when its counterpart expense is approved or settled.
Concretely: in
isSplitExpenseEditable(DynamicSplitExpensePage.tsx:161-179) — and/or the Save path inonSaveSplitExpense— treat a split whose report isisReportApproved/isSettledas non-removable regardless ofisAdmin, and surface the same blocking error the employee already sees.isReportApproved/isSettledare already imported and computed in this file (used only for the header label today at lines 479-497), so the state is readily available.This makes the admin path behave like the employee path (error shown, no revert), matching the Expected Result.
Investigation details & evidence
Data flow (admin repro):
DynamicSplitExpensePage). Each row'sisEditable=isSplitExpenseEditable(item)→isSplitAction(...)evaluated against that split's own (approved/paid) report.isSplitActionreaches the non-open branch and returnstruefor the admin via|| isAdmin→ arrow shown (SplitListItem.tsx:221-235).removeSplitExpenseFieldfilters the split out and redistributes the total — no approved/paid check.onSaveSplitExpense→ reverse-split path inSplitTransactionUpdate.ts(isReverseSplitOperationkeys offstatusNum, not approved/paid state) → API revert fires → paid expense reverts.Why the employee correctly errors: the employee never gets past step 3 (arrow hidden, "cannot be edited" modal). The blocking error footer they'd otherwise see is surfaced from the backend onto
draftTransaction.errors(DynamicSplitExpensePage.tsx:288-294) viaiou.error.genericEditFailureMessage.Alternative explanation considered: a backend authorization difference (admins allowed to modify settled expenses) likely also contributes — this would need an internal investigation of the split/revert backend command, which lives outside the App repo. Regardless of the backend, the App should not expose or execute the removal of an approved/paid split, so the frontend guard above is the right fix within App.
Confidence: High for the App-side root cause (frontend gate + missing approved/paid guard, both verified in code). Two independent code investigations converged on the same mechanism.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/99190)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Aug 21, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (
External)melvin-bot commentedon Aug 21, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Aug 24, 2026
@shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
shubham1206agra commentedon Aug 26, 2026
I need clarity about what should happen here. https://expensify.slack.com/archives/C01GTK53T8Q/p1787750088310699
melvin-bot commentedon Aug 31, 2026
@shubham1206agra Eep! 4 days overdue now. Issues have feelings too...
31 remaining items
mallenexpensify commentedon Oct 20, 2026
Please comment and tag me if/when payment is due, thx
dmkt9 commentedon Oct 21, 2026
Not caused by #100281. Also occurs in production: #103791 (comment)
lakchote commentedon Oct 21, 2026
@mallenexpensify this one's due now, #100281 hit production on Oct 13. The deploy blocker #103791 wasn't caused by it, the same bug happens on production without it.
mallenexpensify commentedon Oct 21, 2026
Payment Summary
Contributor: @ZhenjaHorbach due $250 via NewDot
Contributor+: @dmkt9 paid $250 via Upwork
@dmkt9 can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022113035647953503693
[-]Split - Approved, Paid and/or Done expense amounts are changed if the last split is in Draft and removed[/-][+][Due for payment 2026-10-21] Split - Approved, Paid and/or Done expense amounts are changed if the last split is in Draft and removed[/+]melvin-bot commentedon Oct 21, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)dmkt9 commentedon Oct 22, 2026
@mallenexpensify I noticed that the job details are just a template. Could you resend the offer?
mallenexpensify commentedon Oct 22, 2026
@dmkt9 apologies, there's been a Chrome +TextExpander bug recently. can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022113380053525892208
dmkt9 commentedon Oct 23, 2026
@mallenexpensify Thanks. I've accepted the offer
mallenexpensify commentedon Oct 23, 2026
@dmkt9 paid, summary updated above. Thx.
garrettmknight commentedon Nov 5, 2026
$250 approved for @ZhenjaHorbach