You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-05-07] Expense - Error shows up when duplicating non-reimbursable expenses #88257
Version Number: 9.3.60-17 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:#84657 Email or phone of affected tester (no customers):jsodijnsdojnodnjsoinjo@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Set Submissions to Instantly.
Disable Approvals and Payments.
Go to staging.new.expensify.com
Go to workspace chat.
Create two non-reimbursable expenses.
Retract each report (open report > More > Retract).
Go to Reports > Expenses.
Bulk select both expenses.
Click dropdown button > Duplicate expenses.
Go back to workspace chat.
Open both new reports.
Expected Result:
Expenses will be duplicated without issue.
Actual Result:
Two reports are created. Each report contains an expense with error.
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #84657 - "[Duplicate Expense] Allow bulk duplication." by @Krishna2323 (High confidence) Related Issues: #84281
Recommendation: REVERT
PR #84657 introduced the bulk expense duplication feature which is confirmed to be the source of this bug. The issue is reproducible on staging but not production (this is a new feature that does not exist in production), making a clean revert the safest path forward.
Assigned: @Krishna2323 (PR author), @situchan (approving reviewer), @JS00001 (approving reviewer) from highest-confidence causing PR only Labels: DeployBlockerCash is kept (Frontend bug — App PR caused this). DeployBlocker was not present and was not modified.
The bug is categorized as "Reproducible in staging? Yes" and "Reproducible in production? N/A - new feature, doesn't exist in prod", which confirms this feature was introduced in the current staging cycle.
The reproduction steps closely follow the test steps defined in PR [Duplicate Expense] Allow bulk duplication. #84657's QA section (bulk duplication via Search > Expenses > bulk select > Duplicate expenses), confirming the regression is in the newly added code path.
The bulkDuplicateExpenses function in Duplicate.ts iterates over selected transactions and calls duplicateExpenseTransaction for each, passing the existingIOUReport and shouldDeferAutoSubmit for proper sequencing. The bug occurs with non-reimbursable expenses specifically, which involve distinct nonReimbursableTotal tracking on the expense report.
Root Cause
The bulkDuplicateExpenses function in src/libs/actions/IOU/Duplicate.ts (introduced by this PR) iterates over selected transactions and builds sequential calls to duplicateExpenseTransaction. For non-reimbursable expenses, the nonReimbursableTotal field on the IOU report is computed per-call in getMoneyRequestInformation in IOU/index.ts. When the first duplicate call produces an optimistic IOU report, subsequent iterations receive it via existingIOUReport, but the nonReimbursableTotal arithmetic across iterations may be incorrect because the optimistic IOU report state is not fully reflected in the module-level allReports cache at the time iteration 2 runs (the comment in the code at line 998-1001 of Duplicate.ts even acknowledges this deferred-state race). This leads to inconsistent report state that the server rejects, surfacing as an error on the duplicated expense. The preconditions (Submissions set to Instantly, Approvals and Payments disabled) likely cause the report to be submitted immediately, exposing the corrupted optimistic state on receipt.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@Krishna2323 / @situchan The PR fixing this issue has been merged! 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]
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: missing edge case of new duplicate feature
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Apr 18, 2026
@JS00001 recently merged #84657, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon Apr 18, 2026
Triggered auto assignment to @cead22 (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Apr 18, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 18, 2026
👋 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:
OSBotify commentedon Apr 18, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #84657 - "[Duplicate Expense] Allow bulk duplication." by @Krishna2323 (High confidence)
Related Issues: #84281
Recommendation: REVERT
PR #84657 introduced the bulk expense duplication feature which is confirmed to be the source of this bug. The issue is reproducible on staging but not production (this is a new feature that does not exist in production), making a clean revert the safest path forward.
Assigned: @Krishna2323 (PR author), @situchan (approving reviewer), @JS00001 (approving reviewer) from highest-confidence causing PR only
Labels:
DeployBlockerCashis kept (Frontend bug — App PR caused this).DeployBlockerwas not present and was not modified.Detailed Analysis
Evidence
https://github.com/Expensify/App/pull/84657).StagingDeployCashfor version9.3.60-17.Verification
src/libs/actions/IOU/Duplicate.ts,src/hooks/useBulkDuplicateAction.ts,src/components/Search/BulkDuplicateHandler.tsx,src/hooks/useSearchBulkActions.tsbulkDuplicateExpensesfunction inDuplicate.tsiterates over selected transactions and callsduplicateExpenseTransactionfor each, passing theexistingIOUReportandshouldDeferAutoSubmitfor proper sequencing. The bug occurs with non-reimbursable expenses specifically, which involve distinctnonReimbursableTotaltracking on the expense report.Root Cause
The
bulkDuplicateExpensesfunction insrc/libs/actions/IOU/Duplicate.ts(introduced by this PR) iterates over selected transactions and builds sequential calls toduplicateExpenseTransaction. For non-reimbursable expenses, thenonReimbursableTotalfield on the IOU report is computed per-call ingetMoneyRequestInformationinIOU/index.ts. When the first duplicate call produces an optimistic IOU report, subsequent iterations receive it viaexistingIOUReport, but thenonReimbursableTotalarithmetic across iterations may be incorrect because the optimistic IOU report state is not fully reflected in the module-levelallReportscache at the time iteration 2 runs (the comment in the code at line 998-1001 ofDuplicate.tseven acknowledges this deferred-state race). This leads to inconsistent report state that the server rejects, surfacing as an error on the duplicated expense. The preconditions (Submissions set to Instantly, Approvals and Payments disabled) likely cause the report to be submitted immediately, exposing the corrupted optimistic state on receipt.21 remaining items
melvin-bot commentedon Apr 30, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 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-05-07. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 30, 2026
@Krishna2323 / @situchan The PR fixing this issue has been merged! 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]
melvin-bot commentedon May 4, 2026
@Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon May 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 7, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 7, 2026
Payment Summary
Contributor: @Krishna2323 due $250 via NewDot
Contributor+: @situchan due $250 via NewDot
@situchan plz complete the BZ checklist and tag me in a post once you have. Thx
situchan commentedon May 8, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: missing edge case of new duplicate feature
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/635176
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-b45f-a770-1282-f017698b0a54Krishna2323 commentedon May 15, 2026
Requested in ND.
laurenreidexpensify commentedon May 19, 2026
$250 approved for @Krishna2323
laurenreidexpensify commentedon May 23, 2026
$250 approved for @situchan