Skip to content

[$250] [Duplicate expense] Unexpected error message appears after duplicating distance expense offline. #84228

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.31.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: #82005
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has Self DM.
Prerequisite 2: Account has no workspace yet.

  1. Open the staging.new.expensify.com website.
  2. Navigate to Self DM.
  3. Create a map distance expense.
  4. Turn off internet connection.
  5. Open the just created expense.
  6. Tap on "More" > "Duplicate"
  7. Return to chat.
  8. Note that now a second expense is correctly displayed.
  9. Turn on internet connection.
  10. Note that "Unexpected error message" appears below the first expense.
  11. Dismiss the error.
  12. Note that preview of first expense disappears, but whisper remains displayed.
  13. Open the second expense and return to chat.
  14. Note that first expense reappears.

Expected Result:

After duplicating a distance expense while in offline mode, a new expense with the same information should appear, and both expenses should remain correctly displayed after recovering internet connection.

Actual Result:

"Unexpected error" message appears after duplicating a distance expense in offline mode in Self DM, and recovering internet connection.
After dismissing the error, preview of first expense disappears and reappears after opening second expense and returning to chat.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7094124_1772663442653.Duplicate.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022033512920148748500
  • Upwork Job ID: 2033512920148748500
  • Last Price Increase: 2026-03-16

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Mar 5, 2026
  2. added
    DeployBlocker
    on Mar 5, 2026
  3. melvin-bot commented on Mar 5, 2026

    @melvin-bot

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

  4. melvin-bot commented on Mar 5, 2026

    @melvin-bot

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

  5. melvin-bot commented on Mar 5, 2026

    @melvin-bot

    Triggered auto assignment to @brianlee-expensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  6. github-actions commented on Mar 5, 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.
  7. OSBotify commented on Mar 5, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #82005 - "[Duplicate Expenses] Re-enable Distance Expense Support with fixes" by @jjcoffee (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #82005 re-enabled distance expense duplication which was previously disabled. The bug occurs specifically when duplicating distance expenses offline in Self DM (no workspace), then going online. The error appears because the offline transaction data is not properly handled during synchronization.

    Labels: KEEP DeployBlockerCash (this is a frontend bug requiring an App PR fix), REMOVE DeployBlocker (no backend changes needed)

    📋 Detailed Analysis

    Evidence

    1. The issue explicitly mentions PR [Duplicate Expenses] Re-enable Distance Expense Support with fixes #82005 as the source, and Melvin assigned it to the PR author
    2. The bug reproduction steps match exactly the QA steps from PR [Duplicate Expenses] Re-enable Distance Expense Support with fixes #82005 (duplicating distance expense in Self DM while offline)
    3. The bug is only reproducible on staging (where PR [Duplicate Expenses] Re-enable Distance Expense Support with fixes #82005 is deployed), not production (where it does not exist yet)
    4. The issue description states: "N/A - new feature, does not exist in prod"

    Verification

    PR #82005 modified the following files related to duplicate distance expenses:

    • src/libs/actions/IOU/Duplicate.ts - Core duplication logic
    • src/libs/actions/IOU/index.ts - Added existingTransaction parameter handling
    • src/components/MoneyReportHeader.tsx - UI controls
    • src/components/MoneyRequestHeader.tsx - UI controls

    The PR specifically added support for duplicating distance expenses in Self DM (lines 605-635 in Duplicate.ts), which was the exact scenario that triggers the bug.

    Root Cause

    When duplicating a distance expense offline in Self DM:

    1. The duplication creates an optimistic transaction with an existingTransaction object (lines 611-622 in Duplicate.ts)
    2. While offline, this transaction appears correctly in the UI
    3. When going back online, the transaction attempts to sync with the backend
    4. The backend likely rejects the transaction due to incomplete/invalid data structure
    5. This causes the "Unexpected error" message and the expense preview to disappear

    The PR introduced new logic to pass existingTransaction to trackExpense() when duplicating in Self DM, but this data structure may not be properly validated for offline-to-online synchronization.

  8. 87 remaining items

  9. melvin-bot commented on Jun 4, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @akinwale, @mallenexpensify, @jjcoffee, @JS00001, @brianlee-expensify eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  10. JS00001 commented on Jun 8, 2026

    @JS00001
    Contributor

    @akinwale any updates?

  11. akinwale commented on Jun 8, 2026

    @akinwale
    Contributor

    @akinwale any updates?

    None yet. This fell off my radar. I will re-evaluate to determine next steps.

  12. JS00001 commented on Jun 8, 2026

    @JS00001
    Contributor

    Sounds good, thanks!

  13. removed their assignment
    on Jun 29, 2026
  14. akinwale commented on Jul 22, 2026

    @akinwale
    Contributor

    I put this back on the BEC canvas.

  15. removed their assignment
    on Jul 22, 2026
  16. added
    Hot Pick
    on Aug 24, 2026
  17. JS00001 commented on Aug 24, 2026

    @JS00001
    Contributor

    Added hot pick since @akinwale dropped this one

  18. JS00001 commented on Aug 24, 2026

    @JS00001
    Contributor

    Requesting a retest before adding to the BEC canvas

  19. m-natarajan commented on Aug 24, 2026

    @m-natarajan

    Not repro, Windows 11/ Chrome, v9.4.59-3

    84228.mp4
  20. JS00001 commented on Aug 24, 2026

    @JS00001
    Contributor

    this is fixed

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

Metadata

Metadata

Labels

BugHot PickInternalMonthly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions