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
Expense - Unreported split expense cannot be deleted #92231
👋 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.
Root cause: Deleting an unreported self-DM split is gated behind an environment check. In production the delete routes to deleteMoneyRequest (real delete); in staging that short-circuit is skipped, so the split instead falls into the split-resize path and calls updateSplitTransactions. No DeleteMoneyRequest command is ever sent, so the expense is never deleted — exactly matching "reproducible in staging, not production."
This is not a new 9.3.90 regression. The production-only guard was added by Expensify/App#91932 ([CP Staging] Add production guard for selfDM splits, merged 2026-05-28, already in production). The staging path was left broken pending the proper fix, which is the open PR Expensify/App#92055 (Fix bugs for selfDM splits feature).
Proposal
What is the root cause of that problem?
In useDeleteTransactions.ts:185-189, the short-circuit that forces an unreported self-DM split into the real delete path is gated on isProduction:
isProduction comes from useEnvironment(), so it is false on staging. With the guard skipped, the unreported split (created via Split, so it is an expense split with an originalTransactionID) is bucketed into splitTransactionsByOriginalTransactionID and routed to updateSplitTransactions — a "resize the remaining splits" operation, not a delete. The transaction's pendingAction is never set to DELETE and no DeleteMoneyRequest API call is queued, so the confirm modal closes and the row stays.
getChildTransactions carries the same isProduction gate (line 2697), so in staging the sibling splits still count as children, keeping the broken split-resize branch alive.
Why this only repros in staging + verification details
The delete button is not disabled and there is no reportID === '0' guard blocking it — the action runs, it just calls the wrong API.
The "redirect to split-expense edit" path (shouldRedirectDeleteToSplitExpenseEdit) is per-diem-only in both environments, so it is not involved for a regular expense split.
Confidence: High — verified directly in code; the environment gating fully explains the staging/production split. Production logs could confirm that the failing flow emits UpdateSplitTransactions rather than DeleteMoneyRequest, but that isn't needed to make the fix.
What changes do you think we should make in order to solve the problem?
Make the unreported self-DM split delete behave the same in all environments. Two options:
Quick unblock: Remove the isProduction && condition at useDeleteTransactions.ts:186 (and the matching isProduction gate in getChildTransactions at TransactionUtils/index.ts:2697) so unreported self-DM splits route to deleteMoneyRequest everywhere — i.e. apply the production behavior unconditionally.
Do not revert a 9.3.90 PR — the guard that causes this divergence (#91932) is already in production.
Expensify/App#85484 — Cannot delete unreported expense in bulk from new dot (same delete path).
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/92231) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Activity
applause-bot commentedon Jun 1, 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/3d42dc8ebd17a94b90ed826d847952e5b0188e97f198a661faa8239be5d454b5
https://platform.applause.com/services/links/v1/external/bed1984384970d750140ceeb3495633b7b871f7cd008e663578015830bde5a40
melvin-bot commentedon Jun 1, 2026
Triggered auto assignment to @stitesExpensify (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Jun 1, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jun 1, 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 Jun 1, 2026
Issue Analysis
Root cause: Deleting an unreported self-DM split is gated behind an environment check. In production the delete routes to
deleteMoneyRequest(real delete); in staging that short-circuit is skipped, so the split instead falls into the split-resize path and callsupdateSplitTransactions. NoDeleteMoneyRequestcommand is ever sent, so the expense is never deleted — exactly matching "reproducible in staging, not production."This is not a new 9.3.90 regression. The production-only guard was added by Expensify/App#91932 (
[CP Staging] Add production guard for selfDM splits, merged 2026-05-28, already in production). The staging path was left broken pending the proper fix, which is the open PR Expensify/App#92055 (Fix bugs for selfDM splits feature).Proposal
What is the root cause of that problem?
In
useDeleteTransactions.ts:185-189, the short-circuit that forces an unreported self-DM split into the real delete path is gated onisProduction:isProductioncomes fromuseEnvironment(), so it isfalseon staging. With the guard skipped, the unreported split (created via Split, so it is an expense split with anoriginalTransactionID) is bucketed intosplitTransactionsByOriginalTransactionIDand routed toupdateSplitTransactions— a "resize the remaining splits" operation, not a delete. The transaction'spendingActionis never set toDELETEand noDeleteMoneyRequestAPI call is queued, so the confirm modal closes and the row stays.getChildTransactionscarries the sameisProductiongate (line 2697), so in staging the sibling splits still count as children, keeping the broken split-resize branch alive.Why this only repros in staging + verification details
reportID === '0'guard blocking it — the action runs, it just calls the wrong API.shouldRedirectDeleteToSplitExpenseEdit) is per-diem-only in both environments, so it is not involved for a regular expense split.isProduction && isUnreportedSelfDMSplit→nonSplitTransactions→deleteMoneyRequest→DeleteMoneyRequestAPI.updateSplitTransactions, no delete command.UpdateSplitTransactionsrather thanDeleteMoneyRequest, but that isn't needed to make the fix.What changes do you think we should make in order to solve the problem?
Make the unreported self-DM split delete behave the same in all environments. Two options:
src/hooks/useDeleteTransactions.tsand fixes the sibling selfDM-split bugs ([Due for payment 2026-08-07] Split - Self DM disappears after moving one split to workspace and deleting remaining one. #91913 et al.). Confirm it also covers this single-unreported-split delete case.isProduction &&condition atuseDeleteTransactions.ts:186(and the matchingisProductiongate ingetChildTransactionsatTransactionUtils/index.ts:2697) so unreported self-DM splits route todeleteMoneyRequesteverywhere — i.e. apply the production behavior unconditionally.Do not revert a 9.3.90 PR — the guard that causes this divergence (#91932) is already in production.
Related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/92231)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
lakchote commentedon Jun 1, 2026
Not a deploy blocker, it's gated behind an env check. Closing as the new fixes haven't landed yet.