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 2025-09-19] [Due for payment 2025-09-09] Reports - App crashes when deleting invoice via dropdown button when there is no selection #69344
👋 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.
Please re-state the problem that we are trying to solve in this issue.
When a user selects invoices via checkbox in the Reports > Expenses page, then deletes those invoices individually (by clicking on the invoice and using More > Delete), the bulk actions dropdown remains visible even though no items are selected anymore. When the user then clicks on the dropdown and tries to delete, the app crashes because it attempts to perform bulk operations on empty selections.
What is the root cause of that problem?
The root cause is in the Search component's useEffect that manages selectedTransactions state. When transactions are deleted individually (not through bulk actions), the component correctly identifies that no selected transactions exist in the current data, but it has an early return that prevents clearing the selectedTransactions state:
if(isEmptyObject(newTransactionList)){return;// This prevents clearing selectedTransactions}setSelectedTransactions(newTransactionList,data);
This means the selectedTransactions state still contains references to deleted transactions, causing the bulk actions dropdown to remain visible with stale data.
What changes do you think we should make in order to solve the problem?
We need to remove the early return when newTransactionList is empty in the Search component's useEffect. This will ensure that setSelectedTransactions is always called, properly clearing the selected transactions state when all selected items have been deleted individually.
changed the title [-]Reports - App crashes when deleting invoice via dropdown button when there is no selection[/-][+][Due for payment 2025-09-09] Reports - App crashes when deleting invoice via dropdown button when there is no selection[/+]on Sep 2, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.0-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@lakchote@sakluger 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]
changed the title [-][Due for payment 2025-09-09] Reports - App crashes when deleting invoice via dropdown button when there is no selection[/-][+][Due for payment 2025-09-19] [Due for payment 2025-09-09] Reports - App crashes when deleting invoice via dropdown button when there is no selection[/+]on Sep 12, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.12-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@lakchote@sakluger 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]
Activity
melvin-bot commentedon Aug 27, 2025
Triggered auto assignment to @sakluger (
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.melvin-bot commentedon Aug 27, 2025
Triggered auto assignment to @lakchote (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Aug 27, 2025
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Aug 27, 2025
👋 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:
lakchote commentedon Aug 27, 2025
Comes from #67216 cc @bernhardoj @AndrewGable
ShridharGoel commentedon Aug 27, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user selects invoices via checkbox in the Reports > Expenses page, then deletes those invoices individually (by clicking on the invoice and using More > Delete), the bulk actions dropdown remains visible even though no items are selected anymore. When the user then clicks on the dropdown and tries to delete, the app crashes because it attempts to perform bulk operations on empty selections.
What is the root cause of that problem?
The root cause is in the Search component's
useEffectthat managesselectedTransactionsstate. When transactions are deleted individually (not through bulk actions), the component correctly identifies that no selected transactions exist in the current data, but it has an early return that prevents clearing theselectedTransactionsstate:See:
src/components/Search/index.tsx:445-450This means the
selectedTransactionsstate still contains references to deleted transactions, causing the bulk actions dropdown to remain visible with stale data.What changes do you think we should make in order to solve the problem?
We need to remove the early return when
newTransactionListis empty in the Search component'suseEffect. This will ensure thatsetSelectedTransactionsis always called, properly clearing the selected transactions state when all selected items have been deleted individually.File link:
src/components/Search/index.tsxChange needed:
This ensures the selected transactions state is always synchronized with the current search results data.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can have unit tests or integration tests for this.
8 remaining items
[-]Reports - App crashes when deleting invoice via dropdown button when there is no selection[/-][+][Due for payment 2025-09-09] Reports - App crashes when deleting invoice via dropdown button when there is no selection[/+]melvin-bot commentedon Sep 2, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Sep 2, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.0-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
bernhardoj/fix/66028-deleted-expense-is-unselected-before-remove#69396If no regressions arise, payment will be issued on 2025-09-09. 🎊
melvin-bot commentedon Sep 2, 2025
@lakchote @sakluger 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]
[-][Due for payment 2025-09-09] Reports - App crashes when deleting invoice via dropdown button when there is no selection[/-][+][Due for payment 2025-09-19] [Due for payment 2025-09-09] Reports - App crashes when deleting invoice via dropdown button when there is no selection[/+]melvin-bot commentedon Sep 12, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.12-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
bernhardoj/fix/66028-deleted-expense-is-unselected-before-remove#69396If no regressions arise, payment will be issued on 2025-09-19. 🎊
melvin-bot commentedon Sep 12, 2025
@lakchote @sakluger 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]