Skip to content

[Due for payment 2026-04-30] Expense - Selection mode inconsistency after bulk duplicating expenses on Inbox and Reports #87609

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.58-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: #84657
Email or phone of affected tester (no customers): jsdjosidjiojisojio3@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: iPhone 15 Pro Max / iOS 26.3
App Component: Search

Action Performed:

  1. Launch Expensify app.
  2. Go to workspace chat.
  3. Create two expenses.
  4. Open the report.
  5. Bulk select all expenses.
  6. Tap dropdown button > Duplicate expenses.
    → Selection mode remains after bulk duplicating expenses.
  7. Go to Reports > Expenses.
  8. Bulk select all expenses.
  9. Tap dropdown button > Duplicate expenses.
    → Selection mode exits after bulk duplicating expenses.

Expected Result:

After bulk duplicating expenses from Inbox and Reports, selection mode should behave the same.

Actual Result:

In Step 6, after bulk duplicating expenses from Inbox, selection mode remains.
In Step 9, after bulk duplicating expenses from Reports, selection mode exits.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @Krishna2323

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 10, 2026
  2. melvin-bot commented on Apr 10, 2026

    @melvin-bot

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

  3. melvin-bot commented on Apr 10, 2026

    @melvin-bot

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

  4. github-actions commented on Apr 10, 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.
  5. OSBotify commented on Apr 10, 2026

    @OSBotify
    Contributor

    Investigation Summary: Frontend bug. Causing PR: #84657 "[Duplicate Expense] Allow bulk duplication." by @Krishna2323 (High confidence). Related: #84281. Recommendation: REVERT. The PR introduced an inconsistency in how clearSelectedTransactions is called after bulk duplication from different screens. Assigned: @Krishna2323 (author), @situchan @JS00001 (approving reviewers). Labels: DeployBlockerCash retained.

  6. MelvinBot commented on Apr 10, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    When bulk duplicating from Inbox/Report context, the onAfterDuplicate callback at MoneyReportHeader.tsx:2040 and MoneyRequestReportActionsList.tsx:896 calls clearSelectedTransactions(true). This boolean overload in SearchContext.tsx:255-259 only clears the selected transaction IDs via setSelectedTransactions([]) and returns early — it never sets shouldTurnOffSelectionMode and never calls turnOffMobileSelectionMode().

    In the Search/Reports path, no onAfterDuplicate is provided, so useBulkDuplicateAction.ts:85 calls clearSelectedTransactions(undefined, true) instead, which sets shouldTurnOffSelectionMode: true in context state. An effect in Search/index.tsx:367-370 then picks that up and calls turnOffMobileSelectionMode(). The Report/Inbox path has no equivalent mechanism.

    What changes do you think we should make in order to solve the problem?

    Add turnOffMobileSelectionMode() to the onAfterDuplicate callback in both MoneyReportHeader.tsx and MoneyRequestReportActionsList.tsx:

    onAfterDuplicate={() => {
        clearSelectedTransactions(true);
        turnOffMobileSelectionMode();
    }}
    

    MoneyReportHeader already imports turnOffMobileSelectionMode (line 48). MoneyRequestReportActionsList will need the import added.

    What alternative solutions did you explore? (Optional)

    An alternative would be to modify clearSelectedTransactions so the boolean overload also accepts and processes shouldTurnOffSelectionMode. However, the simpler fix of calling turnOffMobileSelectionMode() directly is consistent with how the back button already works in MoneyReportHeader.tsx:2024-2025.


    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.

  7. OSBotify commented on Apr 10, 2026

    @OSBotify
    Contributor

    Detailed Analysis: The bug is a mismatch in how clearSelectedTransactions is invoked after bulk duplication depending on the screen. In the Inbox (workspace chat / report view), MoneyRequestReportActionsList.tsx line 896 passes onAfterDuplicate={() => clearSelectedTransactions(true)} to BulkDuplicateHandler. In SearchContext.tsx, when clearSelectedTransactions receives a boolean true as its first argument, it takes the short path: setSelectedTransactions([]) — only clearing selectedTransactionIDs, but NOT setting shouldTurnOffSelectionMode to true. So the mobile selection mode UI stays active (bug). In Reports > Expenses (Search page), no onAfterDuplicate is passed, so useBulkDuplicateAction falls back to clearSelectedTransactions(undefined, true). The second argument sets shouldTurnOffSelectionMode: true in context state. A useEffect in Search/index.tsx (line 368) then detects the empty selection combined with that flag and calls turnOffMobileSelectionMode() — correctly exiting selection mode. The precise fix is to change line 896 in MoneyRequestReportActionsList.tsx to call clearSelectedTransactions(undefined, true) instead of clearSelectedTransactions(true). However since this is a new staging-only feature, reverting PR #84657 is the safest path.

  8. situchan commented on Apr 10, 2026

    @situchan
    Contributor

    This feature is gated behind production so we can demote.

  9. 4 remaining items

  10. Krishna2323 commented on Apr 13, 2026

    @Krishna2323
    Contributor

    PR fixing this issue is up: #87697

    cc: @situchan

  11. JS00001 commented on Apr 17, 2026

    @JS00001
    Contributor

    PR to fix this blocker is merged: #87697

  12. melvin-bot commented on Apr 21, 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.

  13. changed the title [-]Expense - Selection mode inconsistency after bulk duplicating expenses on Inbox and Reports[/-] [+][Due for payment 2026-04-30] Expense - Selection mode inconsistency after bulk duplicating expenses on Inbox and Reports[/+] on Apr 23, 2026
  14. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.61-4 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-04-30. 🎊

    For reference, here are some details about the assignees on this issue:

    • @Krishna2323 requires payment through NewDot Manual Requests
    • @situchan requires payment through NewDot Manual Requests
  16. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    @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]

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions