Skip to content

Expense-In self dm, unable to delete the split expense. #94532

Closed

Description

@applause-bot

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: V9.4.19-1
Reproducible in staging?: Yes
Reproducible in production?: No
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/TR-36581/folder/13176670/47002824/1453338367?sort=-identifier
Email or phone of affected tester (no customers): dreamnitethedragon+vegst@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Redmi note 10s android 13
App Component: Money Requests

Action Performed:

  1. Launch app
  2. Open self dm
  3. Create a Expense
  4. Open the expense - more - split the expense
  5. Open a split expense - more - delete

Expected Result:

In self dm, must be able to delete the split expense.

Production behaviour: split option is not shown.

Actual Result:

In self dm, unable to delete the split expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7190542_1782361400489.Screenrecorder-2026-06-25-09-48-11-49.1.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7190542

Issue OwnerCurrent Issue Owner: @mananjadhav

Activity

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

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/6879ff67c8a9c938bfc5178f88fd3b084b6ef3a42cc6bd4418fbe2e30cc6294e

  3. melvin-bot commented on Jun 25, 2026

    @melvin-bot

    Triggered auto assignment to @stitesExpensify (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Jun 25, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 25, 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.
  6. MelvinBot commented on Jun 25, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    In a self DM, after splitting an existing expense (more → "Split the expense"), opening one of the resulting split expenses and trying to delete it (more → Delete) does nothing — the split can't be deleted.

    What is the root cause of that problem?

    Splitting an expense in a self DM is a not-yet-shipped feature that is hidden in production and only visible on staging/dev builds. The bug report confirms this — "Production behaviour: split option is not shown." The whole flow is gated on isProduction rather than a beta, and the delete path for the splits it produces is incompletely gated, so deleting a self-DM split routes into a "redistribute" path instead of an actual delete.

    The entry point is hidden in prod via ReportSecondaryActionUtils.ts:148-151 (return !isProduction), and initSplitExpense early-returns in prod for self DM at SplitExpenses.ts:69-71. So on the staging build (V9.4.19-1) the option appears and creates split children that are unreported transactions on the self DM (moneyRequestReportID = UNREPORTED_REPORT_ID).

    The delete then breaks because the self-DM/unreported short-circuit in the delete grouping is itself prod-only:

    Delete path evidence

    useDeleteTransactions.ts:199-203 — the isUnreportedSelfDMSplit short-circuit to the normal delete path runs only when isProduction:

    const isUnreportedSelfDMSplit = transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
    if (isProduction && isUnreportedSelfDMSplit) {
        acc.nonSplitTransactions.push(item);   // normal deleteMoneyRequest path
        return acc;
    }

    On the staging build (isProduction === false), the split instead falls into splitTransactionsByOriginalTransactionID and is handled by the split restore/redistribute path rather than deleteMoneyRequest, so the tapped split is not deleted.

    getChildTransactions — TransactionUtils/index.ts:2787-2798 similarly excludes unreported/self-DM children only in prod, so child counting diverges between environments.

    Separately, the report-action context-menu Delete is hard-blocked for any SPLIT action at ReportUtils.ts:3232-3239 (// For now, users cannot delete split actions), which is why the option is missing from that surface too.

    In short: this is staging-only behavior of an in-progress feature, not a production-facing regression.

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

    Because the feature is intentionally hidden in production, this likely should not block the deploy — confirm with the feature owner. To actually fix it for when self-DM split ships, make the delete path for unreported/self-DM split children environment-consistent: either drop the isProduction && qualifier on the isUnreportedSelfDMSplit short-circuit in useDeleteTransactions.ts:200 and the matching guard in getChildTransactions so unreported self-DM splits route to deleteMoneyRequest in all environments, or fully gate the self-DM split feature off until the delete flow is complete.

    The right call (route-to-delete vs. fully gate off) depends on whether self-DM split is meant to ship soon — the feature owner should confirm the intended direction.

    What alternative solutions did you explore?

    Tracing the SPLIT context-menu action delete (canDeleteReportAction's SPLIT hard-block) — relevant to the context-menu surface, but the header Delete divergence above is the path the tester hit.


    Confidence: High — this is determinable from code; the isProduction gating fully explains why it reproduces on staging but the option doesn't even appear in production.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/94532) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jun 25, 2026
  8. huult commented on Jun 29, 2026

    @huult
    Contributor

    Checking...

  9. huult commented on Jun 29, 2026

    @huult
    Contributor
  10. huult commented on Jun 30, 2026

    @huult
    Contributor

    @blimpich @stitesExpensify This issue was introduced by #91932, which added the isProduction guard. However, it only occurs in the staging and development environments because this feature is intentionally disabled in production.

    I don't think we need to make any changes until #72125 is completed. Alternatively, if you'd prefer to hide the Delete split expense in self DM flow in staging and development until the feature is fully complete, please let me know.

  11. melvin-bot commented on Jun 30, 2026

    @melvin-bot

    @mananjadhav Huh... This is 4 days overdue. Who can take care of this?

  12. stitesExpensify commented on Jul 1, 2026

    @stitesExpensify
    Contributor

    I think that it's fine to just leave as is. Thanks for investigating!

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