Repository navigation
Per diem - No option to delete unreported per diem split expense #97397
Description
Activity
- addedDeployBlockerCashThis issue or pull request should block deploymentThis issue or pull request should block deploymentBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Jul 29, 2026 While Applause doesn't embed attachments for this bug, here are the links for quick view:
You have been assigned to this deploy blocker because you recently merged this PR: #92055
@ZhenjaHorbach you have been assigned to this deploy blocker because you authored the offending PR: #92055
💬 A slack conversation has been started in #expensify-open-source
github-actions commented
on Jul 29, 2026 on Jul 29, 2026 – with GitHub ActionsContributorMore actions👋 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.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
🔍 Investigation Summary
Classification: Frontend bug (App)
Causing PR: Not #92055. That PR ("Fix bugs for selfDM splits feature" by @ZhenjaHorbach) is part of the self-DM splits feature and was auto-assigned because it was recently merged, but it does not touch the code that decides whether the "More" menu shows Delete vs Edit splits (Low confidence it is the direct cause — see Evidence). The behavior comes from the self-DM per-diem split redirect logic inshouldRedirectDeleteToSplitExpenseEdit.
Related Issues: noneRecommendation: NEEDS INVESTIGATION
For an unreported (self-DM) per-diem split with more than one split, the delete affordance is intentionally relabeled from Delete to Edit splits (icon changes from trashcan to split). When only one split remains it reverts to Delete. This looks like deliberate design for per-diem rebalancing, so the feature owners should confirm whether "Edit splits" replacing "Delete" for multi-split unreported per-diem is intended. Reverting #92055 would not fix this (it does not own the relevant code), so a revert is not appropriate; if the QA expectation is correct, a targeted one-line fix in
shouldRedirectDeleteToSplitExpenseEditis the resolution (see Root Cause).Assigned: @ZhenjaHorbach (PR #92055 author), @lakchote and @dmkt9 (reviewers) are already assigned by melvin-bot as the self-DM splits feature owners; no additional assignees added (low confidence in a single specific causing PR).
Labels: No changes.DeployBlockerCashkept (Frontend/App feature bug, added via the deploy-blocker flow, not reproducible in production). NoDeployBlocker(Web) label is present, so nothing to remove.📋 Detailed Analysis
Evidence
- The "More" menu on an opened split is rendered by
MoneyRequestHeaderSecondaryActions.tsx. The DELETE entry's label/icon is swapped to Edit splits whenshouldShowEditSplitOnDeleteActionis true:shouldShowEditSplitOnDeleteAction(L222)- DELETE entry label/icon swap (L447-L449) —
text: shouldShowEditSplitOnDeleteAction ? translate('iou.editSplits') : translate('common.delete')
shouldShowEditSplitOnDeleteAction→shouldOpenSplitExpenseEditFlowOnDelete→getSplitExpenseEditTransactionOnDelete(L106-L139), which for a self-DM per-diem split with multiple children returns the transaction (→ true) → the menu shows Edit splits, not Delete.- The core gate is
shouldRedirectDeleteToSplitExpenseEdit(L2940-L2959): for a split whose source is a per-diem request, the non-production branch returnstruefor any self-DM split — L2952-L2957. Manual (non per-diem) splits fall through toreturn falseat L2952-L2953, which is why manual splits show Delete but per-diem splits show Edit splits. - Why Fix bugs for selfDM splits feature #92055 is not the direct cause: its file list contains
useDeleteTransactions.tsandTransactionUtils/index.ts, but the specific changes are unrelated to this menu decision. InuseDeleteTransactions.tsit modified thedeleteTransactionsreduce (moved-expense split-child grouping) around L225 — notgetSplitExpenseEditTransactionOnDelete. InTransactionUtils/index.tsit added distance-rate fallback and a newisSplitContainerTransactionhelper — it did not modifyshouldRedirectDeleteToSplitExpenseEdit. It did not touchMoneyRequestHeaderSecondaryActions.tsxorReportSecondaryActionUtils.tsat all. - Production vs staging:
shouldRedirectDeleteToSplitExpenseEdithas anisProductionbranch; the "self-DM per-diem split → redirect to edit" behavior only applies in non-production, consistent with the report ("N/A - new feature, doesn't exist in prod"). This is a staging-only, in-development feature.
Verification
- Affected file that renders the menu label:
src/components/MoneyRequestHeaderSecondaryActions.tsx(L222, L447-L449). - Decision helpers:
src/hooks/useDeleteTransactions.ts(L106-L139) andsrc/libs/TransactionUtils/index.ts(L2940-L2959). - The DELETE action itself is still added to the options list via
ReportSecondaryActionUtils.getSecondaryTransactionThreadActions→isDeleteAction(L1216-L1220) →canDeleteMoneyRequestReport(L3214-L3251), which has no per-diem branch. So the entry exists for both manual and per-diem splits — only the label differs. That is why testers perceive "Delete is missing" (they see Edit splits). - I could not
git blame/bisect to pin the exact PR that introduced theisSelfDMSplitbranch: the GitHub GraphQL blame endpoint returns HTTP 502 on these large files, and the local App checkout is a depth-1 shallow clone (single commit, no history). Permalinks above are pinned to currentmainHEAD3db5c7574d8022a4b203aace8b4e08623bc17ed5.
Root Cause
The self-DM per-diem split feature deliberately routes deletion through the "Edit splits" flow when multiple splits exist (so the per-diem total can be redistributed via
redistributeRemainingPerDiemSplitExpenses). Theif (isSelfDMSplit) return truebranch inshouldRedirectDeleteToSplitExpenseEdit(L2955-L2957) makes every self-DM per-diem split use this redirect in staging, so the menu reads Edit splits instead of Delete. If product intent is that unreported per-diem splits should be directly deletable (matching the QA expectation), the targeted fix is to stop returningtrueunconditionally for self-DM per-diem splits in that branch (e.g. only redirect when it is a reported/workspace per-diem split, mirroring the production branch), which restores the Delete label without reverting the broader feature PR.- The "More" menu on an opened split is rendered by
Not a blocker, unreported splits are hidden on production #91932
- addedDailyKSv2KSv2and removedDeployBlockerCashThis issue or pull request should block deploymentThis issue or pull request should block deploymentHourlyKSv2KSv2
on Jul 30, 2026 We hide the delete button because per diem splits should have the same amount as original transaction, and delete button can break this requirement.
Closing this issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.
Version Number: 9.4.46-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #92055
Email or phone of affected tester (no customers): iosjdnojsdoijdisojiso@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests
Action Performed:
Precondition:
Expected Result:
Delete option will be shown.
Actual Result:
Delete option is missing for unreported per diem split expense.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Recording.6118.mp4
View all open jobs on GitHub