Skip to content

[Due for payment 2026-01-23] Reports - Empty report is no longer selected after removing expense from report #79614

Closed

Description

@vincdargento

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.2-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: #75261
Email or phone of affected tester (no customers): oisndjoisdjniosdiojsio@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Search

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Go to Reports > Reports.
  5. Select the report via checkbox.
  6. Open the report.
  7. Click Report > Remove from report.
  8. Click app back button.

Expected Result:

Empty report should remain selected.

Actual Result:

Empty report is no longer selected after removing expense from report.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @dylanexpensify

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Jan 14, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 14, 2026

    @melvin-bot

    Triggered auto assignment to @dylanexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  5. github-actions commented on Jan 14, 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.
  6. OSBotify commented on Jan 14, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #75261 - "Can't select an empty report from the Reports > Reports page" by @lorretheboy (High confidence)
    Related Issues: None

    Recommendation: ROLL FORWARD

    A revert would undo the ability to select empty reports (the feature this PR added), which would reintroduce issue #70591. The fix is straightforward and localized to the selection logic when reports transition from having transactions to being empty.

    Labels: Keeping DeployBlockerCash (fix requires App PR)

    📋 Detailed Analysis

    Evidence

    PR #75261 introduced the ability to select empty reports from the Reports page. The bug occurs specifically when a report transitions from having transactions to being empty:

    1. User selects a report that has transactions → Selection stored by transaction IDs (e.g., selectedTransactions["transactionID123"])
    2. User removes the last transaction from the report → Report now has 0 transactions
    3. Code checks if the now-empty report should remain selected (lines 459-471 in src/components/Search/index.tsx)
    4. BUG: Line 478-480 checks if reportKey in selectedTransactions, but the selection was stored by transaction IDs, not by reportKey
    5. Empty report is not found in selectedTransactions and loses its selection state

    Verification

    The bug is reproducible following the exact steps in the issue:

    • Creating an expense creates a report with 1 transaction
    • Selecting that report stores the transaction ID in selectedTransactions
    • Removing the expense makes the report empty
    • The selection logic fails to maintain selection because it looks for reportKey, not the previous transaction IDs

    Root Cause

    Lines 474-480 in src/components/Search/index.tsx:

    const reportKey = transactionGroup.keyForList;
    const wasReportSelected = reportKey && reportKey in selectedTransactions;
    const hasAnySelected = isExpenseReportType && (wasReportSelected || transactionGroup.transactions.some((transaction) => transaction.transactionID in selectedTransactions));

    When a report has transactions and becomes empty:

    • The previous selection state used transaction IDs as keys
    • After removal, the code checks for reportKey in selectedTransactions
    • Since reportKey was never in selectedTransactions (only transaction IDs were), wasReportSelected is false
    • The report loses its selection state

    The fix needs to check if any transactions from the report were previously selected before the report became empty, and if so, convert that to an empty report selection.

  7. IuliiaHerets commented on Jan 15, 2026

    @IuliiaHerets

    QA team rechecked the issue. The behavior is the same on production; however, since it’s not possible to select an empty report on prod, the issue is considered Not Reproducible

    Screen.Recording.2026-01-15.at.18.17.02.mp4
  8. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jan 16, 2026
  9. changed the title [-]Reports - Empty report is no longer selected after removing expense from report[/-] [+][Due for payment 2026-01-23] Reports - Empty report is no longer selected after removing expense from report[/+] on Jan 16, 2026
  10. melvin-bot commented on Jan 16, 2026

    @melvin-bot

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

  11. melvin-bot commented on Jan 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.3-8 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-01-23. 🎊

  12. melvin-bot commented on Jan 16, 2026

    @melvin-bot

    @luacmartins @dylanexpensify 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

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions