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-05-07] Expense - "You can't export an empty report." is shown when exporting deleted expense #88418
Version Number: 9.3.61-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:#88192 Email or phone of affected tester (no customers):sdsodijnosdjoij@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Delete an expense in workspace chat.
Go to staging.new.expensify.com
Go to Reports > All xpenses.
Enter status:deleted on the search field and search.
Select the deleted expense via checkbox.
Click dropdown button > Export > All Data - expense level.
Expected Result:
All Data - expense level will be hidden if the deleted expense cannot be exported.
Actual Result:
"You can't export an empty report." is shown when exporting deleted expense.
👋 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.
Classification: Frontend bug Causing PR: #88192 - "Export and duplicated deleted expenses" by @jnowakow (High confidence) Related Issues: #88088
Recommendation: REVERT
PR #88192 added the export option to deleted expense bulk actions, but the export flow incorrectly passes the trash report ID, and the backend (or client-side logic) rejects the export with "You can't export an empty report" because deleted transactions are filtered out when resolving report transactions for export.
Assigned: @jnowakow (PR author), @rojiphil@luacmartins (approving reviewers) Labels: DeployBlockerCash kept (Frontend bug — fix is in Expensify/App). No label changes made.
The bug is reproducible on staging only, and the issue is labeled "new feature, doesn't exist in prod" — consistent with this being a staging-only regression introduced by this PR.
The PR's purpose was to allow export and duplicate of deleted expenses via the bulk action dropdown in search results.
The PR moved the allSelectedAreDeleted early-return block from line ~867 (where it returned only the undelete option) to after the exportButtonOption was built (~line 1036), and added exportButtonOption into the deletedTransactionOptions array.
The affected code path is confirmed: useSearchBulkActions.ts is the file that controls which bulk action dropdown items appear in the search header.
Root Cause
Before this PR, when all selected transactions were deleted, the hook returned early with only the "Undelete" option — no export option was shown. This was intentional: deleted transactions belong to the trash report (CONST.REPORT.TRASH_REPORT_ID), not a real expense report.
PR #88192 moved this early-return block to later in the function, after exportButtonOption is constructed, and included exportButtonOption in the deleted-transaction options. When a user then selects "All Data - expense level" export for a deleted expense, the export handler (handleBasicExport) passes the trash report's ID as the reportIDList. The exportSearchItemsToCSV function in Search.ts iterates over report transactions and skips any with pendingAction === DELETE — leaving the report with zero valid transactions. The backend (or the CSV generation logic) then returns the "You can't export an empty report" error.
The fix location is in src/hooks/useSearchBulkActions.ts — either by reverting PR #88192 or by adding a guard inside getExportOptions / handleBasicExport to exclude deleted transactions from the export flow.
PR Expensify/App#88192 added the exportButtonOption to the deletedTransactionOptions array in useSearchBulkActions.ts:1049. Deleted transactions have reportID: '-1' (TRASH_REPORT_ID), which is a pseudo-report that doesn't exist on the backend. When the user triggers an export, the report ID list ['-1'] is sent to the server, which can't find any exportable data and returns "You can't export an empty report."
The client-side empty-report guard at lines 351-364 doesn't catch this because it checks transactionCount on the report object from search results — the trash "report" may have a non-zero transaction count since it aggregates all deleted transactions.
What changes do you think we should make in order to solve the problem?
Remove exportButtonOption from the deletedTransactionOptions array at useSearchBulkActions.ts:1049. Deleted expenses live under a fake report ID (-1) and cannot be exported — the Export option should not be shown for them.
What alternative solutions did you explore? (Optional)
An alternative would be to filter TRASH_REPORT_ID out of reportIDList before sending to the backend in both beginExportWithTemplate and handleBasicExport. However, this is more complex and the result would be the same — nothing to export. Simply hiding the option is the cleaner fix.
Supporting evidence
allSelectedAreDeleted is computed at line 869 by checking if every selected transaction has reportID === CONST.REPORT.TRASH_REPORT_ID
selectedTransactionReportIDs at line 289 resolves to ['-1'] for deleted transactions
Both export paths (beginExportWithTemplate at line 380 and handleBasicExport at line 464) send this -1 report ID to the backend
Possibly related:Expensify/App#88088 — "Deleted expense can be duplicated and exported when bulk selecting it with existing expense" (same area, still open).
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.
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@rojiphil 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 Apr 21, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #88192
melvin-bot commentedon Apr 21, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 21, 2026
👋 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:
OSBotify commentedon Apr 21, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #88192 - "Export and duplicated deleted expenses" by @jnowakow (High confidence)
Related Issues: #88088
Recommendation: REVERT
PR #88192 added the export option to deleted expense bulk actions, but the export flow incorrectly passes the trash report ID, and the backend (or client-side logic) rejects the export with "You can't export an empty report" because deleted transactions are filtered out when resolving report transactions for export.
Assigned: @jnowakow (PR author), @rojiphil @luacmartins (approving reviewers)
Labels:
DeployBlockerCashkept (Frontend bug — fix is inExpensify/App). No label changes made.Detailed Analysis
Evidence
Verification
src/issrc/hooks/useSearchBulkActions.ts.allSelectedAreDeletedearly-return block from line ~867 (where it returned only the undelete option) to after theexportButtonOptionwas built (~line 1036), and addedexportButtonOptioninto thedeletedTransactionOptionsarray.useSearchBulkActions.tsis the file that controls which bulk action dropdown items appear in the search header.Root Cause
Before this PR, when all selected transactions were deleted, the hook returned early with only the "Undelete" option — no export option was shown. This was intentional: deleted transactions belong to the trash report (
CONST.REPORT.TRASH_REPORT_ID), not a real expense report.PR #88192 moved this early-return block to later in the function, after
exportButtonOptionis constructed, and includedexportButtonOptionin the deleted-transaction options. When a user then selects "All Data - expense level" export for a deleted expense, the export handler (handleBasicExport) passes the trash report's ID as thereportIDList. TheexportSearchItemsToCSVfunction inSearch.tsiterates over report transactions and skips any withpendingAction === DELETE— leaving the report with zero valid transactions. The backend (or the CSV generation logic) then returns the "You can't export an empty report" error.The fix location is in
src/hooks/useSearchBulkActions.ts— either by reverting PR #88192 or by adding a guard insidegetExportOptions/handleBasicExportto exclude deleted transactions from the export flow.MelvinBot commentedon Apr 21, 2026
Proposal
What is the root cause of that problem?
PR Expensify/App#88192 added the
exportButtonOptionto thedeletedTransactionOptionsarray inuseSearchBulkActions.ts:1049. Deleted transactions havereportID: '-1'(TRASH_REPORT_ID), which is a pseudo-report that doesn't exist on the backend. When the user triggers an export, the report ID list['-1']is sent to the server, which can't find any exportable data and returns "You can't export an empty report."The client-side empty-report guard at lines 351-364 doesn't catch this because it checks
transactionCounton the report object from search results — the trash "report" may have a non-zero transaction count since it aggregates all deleted transactions.What changes do you think we should make in order to solve the problem?
Remove
exportButtonOptionfrom thedeletedTransactionOptionsarray atuseSearchBulkActions.ts:1049. Deleted expenses live under a fake report ID (-1) and cannot be exported — the Export option should not be shown for them.What alternative solutions did you explore? (Optional)
An alternative would be to filter
TRASH_REPORT_IDout ofreportIDListbefore sending to the backend in bothbeginExportWithTemplateandhandleBasicExport. However, this is more complex and the result would be the same — nothing to export. Simply hiding the option is the cleaner fix.Supporting evidence
allSelectedAreDeletedis computed at line 869 by checking if every selected transaction hasreportID === CONST.REPORT.TRASH_REPORT_IDTRASH_REPORT_IDis defined as'-1'atCONST/index.ts:1317selectedTransactionReportIDsat line 289 resolves to['-1']for deleted transactionsbeginExportWithTemplateat line 380 andhandleBasicExportat line 464) send this-1report ID to the backendPossibly related: Expensify/App#88088 — "Deleted expense can be duplicated and exported when bulk selecting it with existing expense" (same area, still open).
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.luacmartins commentedon Apr 21, 2026
I think we can demote this one since it's a bit of an edge case. @jnowakow can you work on a fix for it tomorrow please?
9 remaining items
melvin-bot commentedon Apr 30, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 30, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 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-05-07. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 30, 2026
@rojiphil 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]
rojiphil commentedon May 1, 2026
@mallenexpensify No payment due here. Please close this issue as this can be included as part of the
deletefeature payment here. Thanksmelvin-bot commentedon May 4, 2026
@rojiphil Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon May 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 7, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)