Skip to content

Expense - Report closes after duplicating per diem expense #82274

Closed

Description

@jponikarchuk

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.18-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: #78792
Email or phone of affected tester (no customers): sjoijsnonisnjidosd@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac
App Component: Money Requests

Action Performed:

Precondition:

  • Workspace has per diem rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Click + > Create expense > Per diem.
  4. Create a per diem expense.
  5. Open the report.
  6. Click More > Duplicate.

Expected Result:

Report will not close after duplicating per diem expense.

Actual Result:

Report closes after duplicating per diem expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    Bug
    on Feb 12, 2026
  2. melvin-bot commented on Feb 12, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 12, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 12, 2026

    @melvin-bot

    Triggered auto assignment to @RachCHopkins (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.

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

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #78792 - "[Duplicate Expenses] Add Per Diem Expense Support" by @jjcoffee (High confidence)
    Related Issues: #76829

    Recommendation: ROLL FORWARD

    The bug is caused by the duplicate per diem flow incorrectly inheriting the isFromGlobalCreate field from the original transaction. When this field is true, it triggers navigation logic in handleNavigateAfterExpenseCreate() that dismisses the report after duplication, regardless of where the duplicate action was initiated.

    The fix is straightforward: explicitly set isFromGlobalCreate: false in the transactionParams when duplicating per diem expenses (similar to how other transaction fields like created are explicitly set to new values). This is a small, targeted change that should be safer than reverting the entire per diem duplicate feature.

    Labels: No label changes needed. Keep DeployBlockerCash since this is a frontend bug affecting the App.

    📋 Detailed Analysis

    Evidence

    PR #78792 added per diem expense duplication support. The bug reproduces exactly as described:

    1. Create a per diem expense
    2. Open the expense report
    3. Click More > Duplicate
    4. Bug: Report closes immediately after clicking Duplicate

    This only affects per diem expenses - regular expense duplication works correctly.

    Verification

    The PR modifies these key files:

    • src/libs/actions/IOU/Duplicate.ts - Added per diem duplication logic (lines 643-655)
    • src/components/MoneyReportHeader.tsx - Added per diem duplicate handling
    • src/components/MoneyRequestHeader.tsx - Added per diem duplicate handling

    The affected code paths are:

    1. Duplicate.ts line 654: Calls submitPerDiemExpense(perDiemParams)
    2. index.ts line 6865: submitPerDiemExpense() calls handleNavigateAfterExpenseCreate({activeReportID, transactionID: transaction.transactionID, isFromGlobalCreate})
    3. index.ts lines 1117-1127: handleNavigateAfterExpenseCreate() checks isFromGlobalCreate and calls dismissModalAndOpenReportInInboxTab() which closes the report

    Root Cause

    In Duplicate.ts line 554, the code spreads the original transaction into transactionParams:

    transactionParams: {
        ...transactionWithoutLinkedAction,  // This includes isFromGlobalCreate from original
        ...transactionDetails,
        // ... other overrides
    }

    When the original per diem was created from the global create button, isFromGlobalCreate: true gets copied to the duplicate. This causes handleNavigateAfterExpenseCreate() to dismiss the report, even though the user initiated the duplicate from within an open report (not from global create).

    The fix is to explicitly set isFromGlobalCreate: false in the per diem duplication flow at Duplicate.ts line 646-650, similar to how created is explicitly set to the current date.

  7. 9 remaining items

  8. RachCHopkins commented on Feb 16, 2026

    @RachCHopkins
    Contributor

    So what's the next steps here?

  9. jjcoffee commented on Feb 16, 2026

    @jjcoffee
    Contributor

    I'll handle it in #82005

  10. melvin-bot commented on Feb 19, 2026

    @melvin-bot

    @jjcoffee, @RachCHopkins, @JS00001 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  11. JS00001 commented on Feb 19, 2026

    @JS00001
    Contributor

    Closing since this was a deploy blocker, @jjcoffee is working on a fix though

  12. added
    Reviewing
    Weekly
    and removed
    Daily
    on Mar 2, 2026
  13. melvin-bot commented on Mar 4, 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. melvin-bot commented on Mar 5, 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

BugEngineeringReviewingWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions