Skip to content

[Due for payment 2026-06-02] [$250] Spend - Duplicate expense option is not shown for deleted expense on group-by view #89872

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.68-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/TR-26105/folder/13176670/104397676/1395677532?sort=-identifier
Email or phone of affected tester (no customers): sjdoisndjosjosjdionji@gmail.com
Issue reported by: Applause Internal Team
Bug source: Regression TC Execution
Device used: Mac 26.2 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense and delete it.
  4. Go to Spend > Expenses.
  5. Enter status:deleted and search.
  6. Select the deleted expense via checkbox.
  7. Click dropdown button.
    → Duplicate expense option is shown in the dropdown.
  8. Unselect the expense.
  9. Enter status:deleted group-by:from and search.
  10. Expand the table.
  11. Select the deleted expense via checkbox.
  12. Click dropdown button.

Expected Result:

Duplicate expense option will be shown for deleted expense on group-by view (consistent with non group-by view in Step 7).

Actual Result:

Duplicate expense option is not shown for deleted expense on group-by view.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7146727_1778121863249.12.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022052782002008443151
  • Upwork Job ID: 2052782002008443151
  • Last Price Increase: 2026-05-15
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    and removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 7, 2026
  2. MelvinBot commented on May 8, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    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.

    Specifically, at useSearchBulkActions.ts:154, change:

    const transaction = allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${id}`];
    

    to:

    const transaction = allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${id}`] ?? selectedTransactions[id]?.transaction;
    

    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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 8, 2026
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 8, 2026
  5. 49 remaining items

  6. melvin-bot commented on Jun 1, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  7. melvin-bot commented on Jun 1, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2052782002008443151/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  8. mallenexpensify commented on Jun 3, 2026

    @mallenexpensify
    Contributor

    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

  9. KJ21-ENG commented on Jun 3, 2026

    @KJ21-ENG
    Contributor

    @mallenexpensify Offer accepted, Thanks!

  10. mallenexpensify commented on Jun 3, 2026

    @mallenexpensify
    Contributor

    @KJ21-ENG paid, summary updated above. Thx.

  11. Krishna2323 commented on Jun 4, 2026

    @Krishna2323
    Contributor

    BugZero Checklist:

    Regression Test Proposal

    Precondition:

    Test:

    1. Log in to New Expensify.
    2. Go to a workspace chat.
    3. Create an expense and delete it.
    4. Go to Spend > Expenses.
    5. Search for status:deleted.
    6. Select the deleted expense via checkbox.
    7. Open the bulk action dropdown.
    8. Verify Duplicate expense is shown.
    9. Unselect the expense.
    10. Search for status:deleted group-by:from.
    11. Expand the grouped row.
    12. Select the deleted expense via checkbox.
    13. Open the bulk action dropdown.
    14. Verify Duplicate expense is shown.
    15. Select Duplicate expense.
    16. Verify the duplicate flow starts instead of silently doing nothing.
    17. Verify that no errors appear in the JS console.

    Offline tests

    1. Repeat the grouped status:deleted group-by:from selection steps while offline.
    2. Verify the app does not crash and no unexpected JS console errors appear.
    3. Reconnect to the network and verify the page remains usable.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-3e49-aa9a-6f91-b10bf71b4784
  12. Krishna2323 commented on Jun 4, 2026

    @Krishna2323
    Contributor

    @mallenexpensify checklist completed ^

  13. laurenreidexpensify commented on Jun 29, 2026

    @laurenreidexpensify
    Contributor

    $250 approved for @Krishna2323

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions