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-06-04] Expense - Potential duplicate message is shown in header for paid expense briefly #88305
Version Number: V9.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):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:
Launch app
Open workspace chat
Create 2 distance manual expense
Open the expense report
Submit, approve and pay the expense
Select both expense and duplicate expenses
Navigate back to remove selection and note header message
Open the expense and note header message
Expected Result:
Potential duplicate message must not shown in header for paid expense briefly on duplicate expenses.
Actual Result:
Potential duplicate message is shown in header for paid expense briefly on duplicate expenses.
👋 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 duplication feature and is directly implicated by melvin-bot's automated assignment. The bug is a UX regression introduced by this PR where the "Potential duplicate" message briefly appears in the header for paid expenses after performing a bulk duplication.
PR #84657 modifies the following files directly relevant to the bug:
src/components/MoneyReportHeader.tsx — added conditional rendering of BulkDuplicateHandler component when isDuplicateOptionVisible is true
src/hooks/useSelectedTransactionsActions.ts — added isDuplicateOptionVisible computed from shouldShowBulkDuplicateOption
src/hooks/useSearchBulkActions.ts — introduced the shouldShowBulkDuplicateOption function
src/hooks/useBulkDuplicateAction.ts — new hook handling bulk duplication
src/components/Search/BulkDuplicateHandler.tsx — new invisible component for bulk duplicate subscriptions
src/libs/actions/IOU/Duplicate.ts — added bulkDuplicateExpenses function
All of these files are confirmed to be in the affected code path.
Root Cause
The shouldShowBulkDuplicateOption function in useSearchBulkActions.ts does not check whether the parent expense report is in a paid/reimbursed state. As a result, when a user selects distance expenses on a paid report, isDuplicateOptionVisible evaluates to true.
This causes the BulkDuplicateHandler component to mount inside MoneyReportHeader.tsx. When the user triggers the bulk duplication and then navigates back (clearing the selection), there is a brief window during which the newly duplicated transactions (or the original transactions) may have DUPLICATED_TRANSACTION violations registered before the component fully unmounts and state settles. During this transition, getReportPrimaryAction evaluates the violation data and temporarily returns REVIEW_DUPLICATES, causing the "Potential duplicate" banner to flash in the expense header.
The fix should add a check in shouldShowBulkDuplicateOption to return false when isReportReimbursed (i.e., stateNum === APPROVED && statusNum === REIMBURSED), mirroring the guard that already exists for the canHoldTransactions check in useSelectedTransactionsActions.ts (line 274-276).
useMoneyReportHeaderStatusBar computes hasDuplicates via hasDuplicateTransactions() without checking whether the report is already settled/paid. The underlying isDuplicate() only checks whether a DUPLICATED_TRANSACTION violation exists and isn't dismissed — it has no awareness of report payment status.
When a report is paid, payMoneyRequest optimistically clears transaction violations, but the server response re-populates them (violations persist server-side after payment). This causes the "Potential duplicate" banner to briefly flash in the header before a subsequent re-render hides it.
What changes do you think we should make in order to solve the problem?
Import isSettled from ReportUtils. This is the minimal fix — paid reports should never show the duplicate banner regardless of what violation data the server returns.
What alternative solutions did you explore? (Optional)
An alternative would be to add the guard inside getStatusBarType() at line 107, but guarding at the hasDuplicates computation is cleaner since it also prevents shouldShowStatusBar from being true due to stale duplicate violations on settled reports.
Another option would be fixing the server to strip DUPLICATED_TRANSACTION violations after payment, but that's a larger change and the client should still be resilient to this.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
[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: The root cause is in backend
[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 20, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #84657
melvin-bot commentedon Apr 20, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 20, 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 20, 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 duplication feature and is directly implicated by melvin-bot's automated assignment. The bug is a UX regression introduced by this PR where the "Potential duplicate" message briefly appears in the header for paid expenses after performing a bulk duplication.
Assigned: @Krishna2323 (PR author), @situchan (approving reviewer), @JS00001 (approving reviewer)
Labels:
DeployBlockerCashkept (App PR caused the issue). No label changes made.Detailed Analysis
Evidence
Verification
PR #84657 modifies the following files directly relevant to the bug:
src/components/MoneyReportHeader.tsx— added conditional rendering ofBulkDuplicateHandlercomponent whenisDuplicateOptionVisibleis truesrc/hooks/useSelectedTransactionsActions.ts— addedisDuplicateOptionVisiblecomputed fromshouldShowBulkDuplicateOptionsrc/hooks/useSearchBulkActions.ts— introduced theshouldShowBulkDuplicateOptionfunctionsrc/hooks/useBulkDuplicateAction.ts— new hook handling bulk duplicationsrc/components/Search/BulkDuplicateHandler.tsx— new invisible component for bulk duplicate subscriptionssrc/libs/actions/IOU/Duplicate.ts— addedbulkDuplicateExpensesfunctionAll of these files are confirmed to be in the affected code path.
Root Cause
The
shouldShowBulkDuplicateOptionfunction inuseSearchBulkActions.tsdoes not check whether the parent expense report is in a paid/reimbursed state. As a result, when a user selects distance expenses on a paid report,isDuplicateOptionVisibleevaluates totrue.This causes the
BulkDuplicateHandlercomponent to mount insideMoneyReportHeader.tsx. When the user triggers the bulk duplication and then navigates back (clearing the selection), there is a brief window during which the newly duplicated transactions (or the original transactions) may haveDUPLICATED_TRANSACTIONviolations registered before the component fully unmounts and state settles. During this transition,getReportPrimaryActionevaluates the violation data and temporarily returnsREVIEW_DUPLICATES, causing the "Potential duplicate" banner to flash in the expense header.The fix should add a check in
shouldShowBulkDuplicateOptionto returnfalsewhenisReportReimbursed(i.e.,stateNum === APPROVED && statusNum === REIMBURSED), mirroring the guard that already exists for thecanHoldTransactionscheck inuseSelectedTransactionsActions.ts(line 274-276).MelvinBot commentedon Apr 20, 2026
Proposal
What is the root cause of that problem?
useMoneyReportHeaderStatusBarcomputeshasDuplicatesviahasDuplicateTransactions()without checking whether the report is already settled/paid. The underlyingisDuplicate()only checks whether aDUPLICATED_TRANSACTIONviolation exists and isn't dismissed — it has no awareness of report payment status.When a report is paid,
payMoneyRequestoptimistically clears transaction violations, but the server response re-populates them (violations persist server-side after payment). This causes the "Potential duplicate" banner to briefly flash in the header before a subsequent re-render hides it.What changes do you think we should make in order to solve the problem?
In
useMoneyReportHeaderStatusBar.tsline 79, guardhasDuplicateswith anisSettledcheck so the duplicates banner is never shown for paid/reimbursed reports:Import
isSettledfromReportUtils. This is the minimal fix — paid reports should never show the duplicate banner regardless of what violation data the server returns.What alternative solutions did you explore? (Optional)
An alternative would be to add the guard inside
getStatusBarType()at line 107, but guarding at thehasDuplicatescomputation is cleaner since it also preventsshouldShowStatusBarfrom being true due to stale duplicate violations on settled reports.Another option would be fixing the server to strip
DUPLICATED_TRANSACTIONviolations after payment, but that's a larger change and the client should still be resilient to this.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.JS00001 commentedon Apr 20, 2026
This is linking to an old PR, which is currently locked to staging, demoting
33 remaining items
melvin-bot commentedon Jun 3, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 3, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
situchan commentedon Jun 4, 2026
This is not a regression from #84657.
Reasoning: #88305 (comment)
situchan commentedon Jun 4, 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: The root cause is in backend
[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/645919
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-9589-a10e-f840-0cf4f18add24mallenexpensify commentedon Jun 5, 2026
Payment Summary
Contributor: @Krishna2323 due $250 via NewDot
Contributor+: @situchan due $250 via NewDot
^ Test case created. Thx
garrettmknight commentedon Jun 16, 2026
$250 approved for @situchan
laurenreidexpensify commentedon Jun 29, 2026
$250 approved for @Krishna2323