Skip to content

[Due for payment 2026-08-07] Split - Self DM disappears after moving one split to workspace and deleting remaining one. #91913

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.84-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: #84382
Email or phone of affected tester (no customers): ibellicotest+2723@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has a workspace.
Prerequisite 2: Account has Self DM.

  1. Open the staging.new.expensify.com website.
  2. Navigate to Self DM.
  3. Create a manual expense.
  4. Open the just created expense.
  5. Click on "More" > "Split" > Save splits.
  6. Open one of the splits.
  7. Click on "More" > "Move to Report" > "Create Report"
  8. Return to Self DM.
  9. Right click and delete the remaining split.
  10. Note that after split is deleted, Self DM disappears from LHN.
  11. Click on the search icon on the top right corner.
  12. Note that Self DM is not visible on search list.

Expected Result:

Self DM should still be visible after deleting a split.

Actual Result:

Self DM disappears from LHN and "Search", after moving on split to workspace and deleting the remaining one.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7164592_1779910674930.Self_Split.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 28, 2026
  2. melvin-bot commented on May 28, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #84382

  3. melvin-bot commented on May 28, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on May 28, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. OSBotify commented on May 28, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #84382 - "Add splits for unreported expenses" by @ZhenjaHorbach (High confidence)
    Related Issues: #72125 (the fixed issue that PR 84382 addressed)

    Recommendation: REVERT

    PR #84382 introduced a large new feature (split expenses for unreported/Self DM expenses) and is the only PR in this staging cycle that touches the split expense deletion flow and Self DM report handling. Reverting it will restore the correct Self DM LHN visibility behavior.

    Assigned: @ZhenjaHorbach (PR author), @dmkt9, @lakchote (approving reviewers)
    Labels: DeployBlockerCash kept (frontend/App bug). No label changes made.

    Detailed Analysis

    Evidence

    Verification

    • PR Add splits for unreported expenses #84382 modifies src/hooks/useDeleteTransactions.ts, src/libs/actions/IOU/SplitTransactionUpdate.ts, src/libs/actions/SplitExpenses.ts, and src/libs/actions/IOU/SplitExpenseItems.ts.
    • These files contain all the code paths exercised by the reproduction steps: splitting in Self DM, moving a split to a workspace report, and deleting the remaining split.
    • The useDeleteTransactions.ts hook introduces logic that resolves selfDMReportID for split transactions with UNREPORTED_REPORT_ID, and calls updateSplitTransactions when deleting the last sibling split — this is the code path triggered by steps 9 and 10 of the reproduction.

    Root Cause

    When one split is moved to a workspace report (step 7) and the remaining split in Self DM is deleted (step 9), the new deletion flow in useDeleteTransactions calls updateSplitTransactions (or falls through to deleteMoneyRequest) with the Self DM report as chatReport. The cleanup Onyx updates inside deleteMoneyRequest — specifically the shouldDeleteIOUReport branch which sets iouReportID: null and nullifies the IOU report — appear to be incorrectly applied to the Self DM report, causing it to lose the data that makes it visible in the LHN and search. Since Self DM should never be deleted or hidden as a side effect of deleting a split transaction, the fix requires correcting how the Self DM report is handled during the split deletion cleanup in PR #84382's new code.

  6. MelvinBot commented on May 28, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When the last remaining split child in Self DM is deleted, it flows through deleteMoneyRequest instead of deleteTrackExpense. This happens because:

    1. Self DM split IOU actions are TRACK-type with IOUReportID: undefined (MoneyRequestBuilder.ts:474-479).
    2. When the last split child is being deleted (childTransactions.length === 0), it gets pushed to nonSplitTransactions (useDeleteTransactions.ts:189-190).
    3. The delete path in MoneyRequestHeaderSecondaryActions.tsx:444 explicitly blocks splits from using deleteTrackExpense (isTrackExpenseAction(parentReportAction) && !isExpenseSplit).
    4. So deleteMoneyRequest is called, but since IOUReportID is undefined, both iouReport and chatReport resolve to undefined (useDeleteTransactions.ts:276-278). This means the optimistic data cannot update the Self DM report or its report actions.

    Additionally, when a split is moved to a workspace via changeTransactionsReport, the old IOU action in Self DM is cleared but lastMessageText on the Self DM report is never recalculated (Transaction.ts:1390-1413). After the move + delete, the Self DM has no visible actions, isEmptyReport() returns true, and it gets filtered out of the LHN.

    What changes do you think we should make in order to solve the problem?

    The fix should be in useDeleteTransactions.ts — when the last split child is deleted (childTransactions.length === 0) and the parent action is a TRACK expense in Self DM, the transaction should be routed through deleteTrackExpense instead of deleteMoneyRequest. This ensures the Self DM report and its report actions are properly updated optimistically (recalculating lastMessageText, etc.), preserving the Self DM's visibility in the LHN.

    Specifically, in the childTransactions.length === 0 branch at line 189, before pushing to nonSplitTransactions, check if the original transaction's IOU action is a track expense. If so, call deleteTrackExpense with the Self DM as the chatReport instead of falling through to the deleteMoneyRequest path.

    What alternative solutions did you explore? (Optional)

    An alternative would be to fix changeTransactionsReport to update lastMessageText on the source report when moving a transaction out. However, this alone wouldn't fully solve the problem — the deleteMoneyRequest path would still fail to properly clean up the Self DM for TRACK-type split actions with no IOUReportID. The correct delete path (deleteTrackExpense) already handles Self DM cleanup properly, so routing to it is the more complete fix.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. 41 remaining items

  8. mitarachim commented on Jul 29, 2026

    @mitarachim
    Author

    Deploy Blocker #97395 was identified to be related to the PR #92055 that attempted to fix this issue.

  9. melvin-bot commented on Jul 30, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  10. jponikarchuk commented on Jul 30, 2026

    @jponikarchuk

    Deploy Blocker #97424 was identified to be related to the PR #92055 that attempted to fix this issue.

  11. melvin-bot commented on Jul 30, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  12. lakchote commented on Jul 30, 2026

    @lakchote
    Contributor
  13. melvin-bot commented on Jul 30, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  14. mitarachim commented on Jul 30, 2026

    @mitarachim
    Author

    Deploy Blocker #97436 was identified to be related to the PR #92055 that attempted to fix this issue.

  15. changed the title [-]Split - Self DM disappears after moving one split to workspace and deleting remaining one.[/-] [+][Due for payment 2026-08-07] Split - Self DM disappears after moving one split to workspace and deleting remaining one.[/+] on Jul 31, 2026
  16. melvin-bot commented on Jul 31, 2026

    @melvin-bot

    @ZhenjaHorbach / @dmkt9

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.46-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-08-07. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

  17. melvin-bot commented on Aug 19, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions