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
Per diem - No option to delete unreported per diem split expense #97397
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:
Workspace has per diem rates.
Go to staging.new.expensify.com
Go to self DM.
Create a per diem expense.
Open the expense.
Click More > Split > Save.
Open any split.
Click More.
Expected Result:
Delete option will be shown.
Actual Result:
Delete option is missing for unreported per diem split expense.
👋 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.
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 in shouldRedirectDeleteToSplitExpenseEdit. Related Issues: none
Recommendation: 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 shouldRedirectDeleteToSplitExpenseEdit is 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. DeployBlockerCash kept (Frontend/App feature bug, added via the deploy-blocker flow, not reproducible in production). No DeployBlocker (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 when shouldShowEditSplitOnDeleteAction is true:
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 returns true for any self-DM split — L2952-L2957. Manual (non per-diem) splits fall through to return false at 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.ts and TransactionUtils/index.ts, but the specific changes are unrelated to this menu decision. In useDeleteTransactions.ts it modified the deleteTransactions reduce (moved-expense split-child grouping) around L225 — notgetSplitExpenseEditTransactionOnDelete. In TransactionUtils/index.ts it added distance-rate fallback and a new isSplitContainerTransaction helper — it did not modify shouldRedirectDeleteToSplitExpenseEdit. It did not touch MoneyRequestHeaderSecondaryActions.tsx or ReportSecondaryActionUtils.ts at all.
Production vs staging: shouldRedirectDeleteToSplitExpenseEdit has an isProduction branch; 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) and src/libs/TransactionUtils/index.ts (L2940-L2959).
I could not git blame/bisect to pin the exact PR that introduced the isSelfDMSplit branch: 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 current main HEAD 3db5c7574d8022a4b203aace8b4e08623bc17ed5.
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). The if (isSelfDMSplit) return true branch in shouldRedirectDeleteToSplitExpenseEdit (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 returning true unconditionally 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.
Activity
applause-bot commentedon Jul 29, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
melvin-bot commentedon Jul 29, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #92055
melvin-bot commentedon Jul 29, 2026
@lakchote @dmkt9 you have been assigned to this deploy blocker because you reviewed the offending PR: #92055
melvin-bot commentedon Jul 29, 2026
@ZhenjaHorbach you have been assigned to this deploy blocker because you authored the offending PR: #92055
melvin-bot commentedon Jul 29, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Jul 29, 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 Jul 29, 2026
🔍 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 in
shouldRedirectDeleteToSplitExpenseEdit.Related Issues: none
Recommendation: 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
MoneyRequestHeaderSecondaryActions.tsx. The DELETE entry's label/icon is swapped to Edit splits whenshouldShowEditSplitOnDeleteActionis true:shouldShowEditSplitOnDeleteAction(L222)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.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.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.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
src/components/MoneyRequestHeaderSecondaryActions.tsx(L222, L447-L449).src/hooks/useDeleteTransactions.ts(L106-L139) andsrc/libs/TransactionUtils/index.ts(L2940-L2959).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).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.lakchote commentedon Jul 30, 2026
Not a blocker, unreported splits are hidden on production #91932
lakchote commentedon 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.