Skip to content

[Due for payment 2026-08-31] Expense - Deleted unreported split reappears when user turns to offline mode. #97400

Closed

Description

@applause-bot

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): ibellicotest+2766@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: 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. Return to chat.
  7. Right click and delete both splits.
  8. Turn to offline mode.
  9. Note that deleted split reappears in chat when user is in offline mode.
  10. Turn to online mode.
  11. Note that split disappears again.

Expected Result:

Deleted splits shouldn´t reappear when user is in offline mode.

Actual Result:

Deleted split becomes visible again when user turns to offline mode.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7221286_1785360059649.Deleted_Split.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7221286

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 Jul 29, 2026
  2. applause-bot commented on Jul 29, 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/60398abd67c956ee2a13ee5d6fdc6b805ef68b7220c87f64dda509a443089f0c

  3. melvin-bot commented on Jul 29, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jul 29, 2026

    @melvin-bot

    @lakchote @dmkt9 you have been assigned to this deploy blocker because you reviewed the offending PR: #92055

  5. melvin-bot commented on Jul 29, 2026

    @melvin-bot

    @ZhenjaHorbach you have been assigned to this deploy blocker because you authored the offending PR: #92055

  6. melvin-bot commented on Jul 29, 2026

    @melvin-bot

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

  7. github-actions commented on Jul 29, 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.
  8. MelvinBot commented on Jul 29, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #92055 - "Split expense from Self DM / unreported expense" by @ZhenjaHorbach (High confidence)
    Related Issues: N/A (new feature, not in production)

    Recommendation: REVERT

    The bug is entirely inside the new self-DM / unreported split-delete flow shipped by this PR; it is staging-only and does not exist in production. Reverting #92055 cleanly unblocks the App deploy. A targeted roll-forward is also viable (see Root Cause) if the team prefers to keep the feature on staging.

    Assigned: @ZhenjaHorbach (PR author), @lakchote and @dmkt9 (approving reviewers) — already assigned by Melvin.
    Labels: No changes. DeployBlockerCash is the only blocker label present and is correctly kept (Frontend bug — App deploy blocked). No DeployBlocker present to remove.

    📋 Detailed Analysis

    Evidence

    • Timeline: Fix bugs for selfDM splits feature #92055 merged 2026-07-29T09:35Z; issue reported the same day against 9.4.46-0. It is item The mobile app opens up with the keyboard showing #76 in the current StagingDeployCash (#97375).
    • Prod vs staging: Reproducible on staging, N/A in production — this is exactly the "Split expense from Self DM / unreported expense" feature that Fix bugs for selfDM splits feature #92055 introduces, so no prod code path exists.
    • Scope match: The PR is the only change touching the split-delete code paths: src/hooks/useDeleteTransactions.ts, src/libs/actions/IOU/SplitTransactionUpdate.ts, src/libs/actions/IOU/SplitExpenseItems.ts, src/libs/actions/IOU/Split.ts.
    • The PR's own code comments explicitly acknowledge this class of bug — a split "remains visible ... when offline" — and add a partial fix that does not cover the deleted split.

    Verification

    • Affected feature: deleting split children created from a Self-DM / unreported expense.
    • Delete routing lives in useDeleteTransactions.deleteTransactions, which groups split children by original transaction and calls updateSplitTransactions(...), notably forwarding isOffline:
    • The deleted-split branch and the reverse-split fix live in SplitTransactionUpdate.ts:
    • The IOU report-action delete data is built by getDeleteTrackExpenseInformation:

    Root Cause

    When splits from a Self DM are deleted, the flow reaches updateSplitTransactions. For each split being removed it calls getDeleteTrackExpenseInformation, which optimistically marks that split's IOU report action with only pendingAction: DELETE (not removal), and only clears/removes it in successData — i.e. after the server responds:

    The PR authors already discovered that a split marked merely pendingAction: DELETE stays visible offline (a split-expense preview action is not rendered as a deleted comment the way a normal message is). Their fix — SplitTransactionUpdate.ts L1361-L1416 — sets the report action to null in optimisticData so it disappears offline too. But that null-removal is gated on forceDeleteSplitTransactionID, which is set only for the reverse-split operation and points only at the kept/merged split (splitExpenses.at(0)):

    const forceDeleteSplitTransactionID = isReverseSplitOperation ? splitExpenses.at(0)?.transactionID : undefined;   // L1366
    

    So the split that is actually being deleted (the undeletedTransaction iterated at L1341) never gets the optimistic null removal — it keeps pendingAction: DELETE only. Result:

    • Online: successData (server round-trip) finishes the removal → the split disappears.
    • Offline: successData never runs and pendingAction: DELETE alone doesn't hide the split preview → the deleted split reappears, then vanishes again once back online. This is exactly the reported symptom.

    Roll-forward fix option (if not reverting): extend the optimistic report-action null removal at L1401-L1406 to cover every deleted split in the loop (not just forceDeleteSplitTransactionID), pushing value: {[currentReportAction.reportActionID]: null} to optimisticData (with the matching failureData restore) for each undeletedTransaction, so the deletion is hidden offline as well as online.

  9. 11 remaining items

  10. changed the title [-]Expense - Deleted unreported split reappears when user turns to offline mode.[/-] [+][Due for payment 2026-08-31] Expense - Deleted unreported split reappears when user turns to offline mode.[/+] on Aug 24, 2026
  11. melvin-bot commented on Aug 24, 2026

    @melvin-bot

    @ZhenjaHorbach / @dmkt9

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.59-5 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-31. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]

  12. ZhenjaHorbach commented on Aug 25, 2026

    @ZhenjaHorbach
    Contributor

    @lakchote
    I suppose we can close this

  13. lakchote commented on Aug 27, 2026

    @lakchote
    Contributor

    @lakchote I suppose we can close this

    Yes, done!

  14. added
    ReviewingHas a PR in review
    and removed on Oct 7, 2026
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.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions