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-02] [$250] Spend - Duplicate expense option is not shown for deleted expense on group-by view #89872
shouldShowBulkDuplicateOption (useSearchBulkActions.ts:153-155) looks up each selected transaction from allTransactions, which is built by useAllTransactions. This hook merges transactions found in currentSearchResults?.data with the Onyx TRANSACTION collection.
In the non-group-by view, currentSearchResults?.data contains individual transaction entries (e.g., transaction_XYZ), so the lookup succeeds. In the group-by view, currentSearchResults?.data contains only group-level aggregate items — individual transactions are fetched via separate sub-snapshots (useMultipleSnapshots) and never written back to currentSearchResults?.data or the Onyx TRANSACTION collection. So the lookup returns undefined, shouldShowBulkDuplicateOption returns false, and the Duplicate option is hidden.
What changes do you think we should make in order to solve the problem?
In shouldShowBulkDuplicateOption, instead of only looking up the transaction from allTransactions, fall back to the transaction already stored in selectedTransactions[id]?.transaction (which is populated from the rendered item data, including group-by sub-snapshot data). This way, when the transaction isn't found in allTransactions (as happens in the group-by view), the function can still access the transaction object and evaluate the duplicate eligibility guards.
This is the minimal fix — it uses the same transaction data that's already available in the selection state, requires no changes to useAllTransactions or the snapshot plumbing, and maintains consistent behavior between grouped and non-grouped views.
What alternative solutions did you explore? (Optional)
An alternative would be to modify useAllTransactions to also incorporate transactions from group-by sub-snapshots. However, that would require threading the sub-snapshot data through the search context, which is a larger change with more surface area. The selectedTransactions fallback is simpler and already contains the correct transaction data.
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 and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[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: N/A
[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
MelvinBot commentedon May 8, 2026
Proposal
What is the root cause of that problem?
shouldShowBulkDuplicateOption(useSearchBulkActions.ts:153-155) looks up each selected transaction fromallTransactions, which is built byuseAllTransactions. This hook merges transactions found incurrentSearchResults?.datawith the OnyxTRANSACTIONcollection.In the non-group-by view,
currentSearchResults?.datacontains individual transaction entries (e.g.,transaction_XYZ), so the lookup succeeds. In the group-by view,currentSearchResults?.datacontains only group-level aggregate items — individual transactions are fetched via separate sub-snapshots (useMultipleSnapshots) and never written back tocurrentSearchResults?.dataor the OnyxTRANSACTIONcollection. So the lookup returnsundefined,shouldShowBulkDuplicateOptionreturnsfalse, and the Duplicate option is hidden.What changes do you think we should make in order to solve the problem?
In
shouldShowBulkDuplicateOption, instead of only looking up the transaction fromallTransactions, fall back to the transaction already stored inselectedTransactions[id]?.transaction(which is populated from the rendered item data, including group-by sub-snapshot data). This way, when the transaction isn't found inallTransactions(as happens in the group-by view), the function can still access the transaction object and evaluate the duplicate eligibility guards.Specifically, at
useSearchBulkActions.ts:154, change:to:
This is the minimal fix — it uses the same transaction data that's already available in the selection state, requires no changes to
useAllTransactionsor the snapshot plumbing, and maintains consistent behavior between grouped and non-grouped views.What alternative solutions did you explore? (Optional)
An alternative would be to modify
useAllTransactionsto also incorporate transactions from group-by sub-snapshots. However, that would require threading the sub-snapshot data through the search context, which is a larger change with more surface area. TheselectedTransactionsfallback is simpler and already contains the correct transaction data.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.49 remaining items
melvin-bot commentedon Jun 1, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 1, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Jun 3, 2026
Payment Summary
Contributor: @KJ21-ENG paid $250 via Upwork
Contributor+: @Krishna2323 due $250 via NewDot
@KJ21-ENG can you please accept the job below? Please reply here and tag me once you have.
https://www.upwork.com/jobs/~022052782002008443151
@Krishna2323 plz complete the BZ checklist and tag me in a post once you have. Thx
KJ21-ENG commentedon Jun 3, 2026
@mallenexpensify Offer accepted, Thanks!
mallenexpensify commentedon Jun 3, 2026
@KJ21-ENG paid, summary updated above. Thx.
Krishna2323 commentedon Jun 4, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: [Duplicate Expense] Allow bulk duplication. #84657 (comment)
Link to the comment on the Issue: [Duplicate Expense] Allow bulk duplication #84281 (comment)
[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: N/A
[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/645629
Regression Test Proposal
Precondition:
Test:
Offline tests
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-3e49-aa9a-6f91-b10bf71b4784Krishna2323 commentedon Jun 4, 2026
@mallenexpensify checklist completed ^
laurenreidexpensify commentedon Jun 29, 2026
$250 approved for @Krishna2323