Description
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: v9.4.66-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/71924520/folder/53991585/110878718/1717129043?sort=%2Bidentifier
Email or phone of affected tester (no customers): leungbratt6+02096@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 10/Chrome
App Component: Chat Report View
Action Performed:
Preconditions: User has created 2 Per Diem expenses in Workspace chat
- Open the New Dot app
- Navigate to Workspace chat - Delete the report
- Go to selfDM and locate the per diem expense
- Click on one of the per diem -> More -> Split -> Save
- Click on one of the splits - More - Edit split - Remove split
- Repeat the same step on another split per diem
Expected Result:
Split Per Diem expense reverts to the original Per Diem
Actual Result:
Nothing happen
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome Safari
Screenshots/Videos
Bug7248708_1788331318969.per_diem.mp4
Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7248708
Issue Owner
Current Issue Owner: @mallenexpensifyUpwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022105233710370818055
- Upwork Job ID: 2105233710370818055
- Last Price Increase: 2026-09-30
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
applause-bot commentedon Sep 2, 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/61ebcf09a932d498ecee5f6219723d9136dc95c13f53404609fe3911d10b3640
MelvinBot commentedon Sep 24, 2026
Proposal
What is the root cause of that problem?
"Remove split" never saves anything — it only edits a local draft. The revert to the original per diem is a separate API call that only fires when you press Save on the split overview screen afterwards.
src/pages/iou/DynamicSplitExpenseEditPage.tsx:551-564callsremoveSplitExpenseFieldand navigates back. That function filters the split out of the array, redistributes amounts, and does exactly oneOnyx.mergeintosplitTransactionDraft_<originalTransactionID>. There is noAPI.write, no optimistic data, no transaction change. The real revert isRevertSplitTransaction, reached only via Save →updateSplitTransactionsFromSplitExpensesFlow→isReverseSplitOperation→SplitTransactionUpdate.ts:2012-2019.Why only per diem hits this. Per diem is the only expense type whose split child's Delete is rerouted into this draft-edit screen.
shouldRedirectDeleteToSplitExpenseEditreturnsfalseunless the source transaction is per diem, and returnstrueunconditionally for a selfDM per-diem split. When it's true, the More menu relabels Delete as "Edit splits" (MoneyRequestHeaderSecondaryActions.tsx:545-553) and drops you on the split-edit RHP. For every other type, Delete really deletes and the split collapses on its own. So per diem is the only type where "undo this split" lands on a screen whose only destructive button is a draft edit needing a second, unadvertised Save — which matches the repro steps exactly (step 4 says "Save", step 5 does not).Investigation details, two secondary defects, and what I could not verify
The last split can never be removed. The button is gated on
Number(splitExpensesList?.length) > 1, so with 2 splits you can remove one, and the remaining one has no Remove button. That's intentional — 1 split is the revert — but it only materialises on Save.Secondary defect 1 (selfDM-only, confirmed).
SplitTransactionUpdate.ts:310readsreportActions_${revertSplitTransaction?.reportID}, but a selfDM split child'sreportIDis'0'(UNREPORTED_REPORT_ID), so the lookup always misses.splitTransactionThreadReportIDstaysundefinedand the comment-migration block gated at line 1924 is dead code for every selfDM reverse split — comments on the split thread are silently lost. The same file already does the correct mapping at lines 1391-1393.Secondary defect 2 (per-diem data loss).
buildOptimisticTransactiononly writescomment.customUnitfor distance transactions or whenpendingFields.subRatesis set. Neither split-draft builder sets it — the "already split" branch atSplitExpenses.ts:116-130passes nocustomUnitat all — so per-diem split drafts losesubRates,customUnitIDandattributes.dates, and stop being detectable as per diem byisPerDiemRequest.redistributeSplitExpenseAmountsthen rewritesamountwithout touchingsubRates, leaving the survivor with 100% of the total but the parent's full per-diem breakdown. There is no per-diem branch anywhere inSplitExpenseItems.ts— every branch isisDistanceRequestvs. everything-else — and the three split test suites have zero per-diem coverage.Alternative explanations I ruled out. The per-diem save gate at
DynamicSplitExpensePage.tsx:327-335blocks Save on acustomUnitOutOfPolicyviolation, butdeleteAppReportclears violations when the workspace report is deleted, and the same gate would have blocked step 4's Save. The Onyx merge key inremoveSplitExpenseFieldis correct in the selfDM case —resolveSplitItemReportIDmaps'0'back to the real selfDM report ID.Onyx.mergereplaces arrays rather than merging them, so the filtered array does take effect.Not verified. I could not reproduce this or view the attached video (sandboxed), so I can't confirm the tester never pressed Save versus Save firing and silently failing. Two things would settle it: whether
RevertSplitTransactionwas ever issued for this transaction, and whether the client logged[Split] Can't find the report action for transaction(SplitTransactionUpdate.ts:1405).What changes do you think we should make in order to solve the problem?
DynamicSplitExpenseEditPage.tsx:551, when removing leaves exactly one split and child transactions already exist, commit the revert immediately via the same reverse-split path Save uses, rather than only writing the draft. If we'd rather keep Save as the commit point, the edit screen must at minimum return to the overview with a visible unsaved-state cue, because today the screen looks identical before and after.SplitTransactionUpdate.ts:310to mapUNREPORTED_REPORT_IDto the selfDM report ID, matching lines 1391-1393.customUnitthrough per-diem split drafts sosubRates/customUnitID/attributes.datessurvive, and giveremoveSplitExpenseField/redistributeSplitExpenseAmountsa per-diem branch so a redistributed amount doesn't contradict the sub-rates. Add per-diem cases to the split test suites, which currently have none.What alternative solutions did you explore? (Optional)
isPerDiemRequestspecial case inshouldRedirectDeleteToSplitExpenseEditso Delete on a per-diem split behaves like every other type. Simplest fix for the reported symptom, but it discards whatever the redirect was added for.Related issues
SplitExpenseItems.ts.Neither looks like a duplicate.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/100130)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 Sep 24, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (
External)melvin-bot commentedon Sep 24, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
linhvovan29546 commentedon Sep 25, 2026
@MelvinBot implement this
MelvinBot commentedon Sep 25, 2026
🤖 Draft PR created: Revert a per diem split right away when removing a split leaves only one
Please mark it as "Ready for review" when it is ready for review.
What changed: On a per diem expense that is already split, Remove split now reverts the expense to the original right away when only one split would be left. Before, you also had to press Save on the split overview. The revert uses the same save path as the overview's Save, which now lives in a shared
useSaveSplitExpenseshook.What's different from the proposal:
customUnit/subRatesin per diem drafts): not included. The reported bug doesn't need it, so it can be a separate follow-up.Testing: Typecheck, lint, formatting, spell check, and the React Compiler check all pass. The related Jest suites pass (178 of 178), including a new test. I didn't test the flow in a browser because the test account has no workspace with per diem rates. You still need to fill in the Tests and QA sections.
linhvovan29546 commentedon Sep 25, 2026
MelvinBot proposal LGTM!
🎀 👀 🎀 C+ reviewed
22 remaining items
melvin-bot commentedon Oct 13, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 13, 2026
Payment Summary
Resolving PRs:
Return to the split overview after Remove split when editing a per diem split #102271
Reviewer: @linhvovan29546 owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Oct 16, 2026
@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
mallenexpensify commentedon Oct 16, 2026
Payment Summary
Contributor+: @linhvovan29546 due $175 via NewDot
twisterdotcom commentedon Nov 17, 2026
$175 approved for @linhvovan29546 in Report ID: R00YISUXxump.
Zapier Logs
Run ID: 00040eee-6f67-aedc-9532-5f423b038224SO: https://stackoverflowteams.com/c/expensify/questions/7582