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
Download PDF option is not available when bulk selecting reports as admin #102084
Version Number: 9.4.92-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:#96667 Email or phone of affected tester (no customers):emady.syed1234+hero11@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 / Chrome, realme C21Y , iPhone 12 App Component: Money Requests
Action Performed:
Open App as admin
Go to spend > reports
Bulk select all reports
Tap on dropdown menu
Expected Result:
Download PDF should be available when using Select all
Actual Result:
Download PDF is not available when using Select all
Confidence: Medium. Verified from code and build history. I could not drive NewDot in a browser on this run, so the retest below still needs a human.
Short version: the fix for this is already on staging and, as far as the code goes, it works. The QA steps look in the wrong place and for a label that no longer exists.
What is the root cause of that problem?
There are three separate things going on. Only the third is a real defect.
1. "Reproducible in production: Yes" is expected and not evidence.
9.4.92-1-staging — contains the fix (status: ahead, behind_by: 0)
9.4.91-3 (production at test time) — does not contain it
So production failing is just "production doesn't have the fix yet." Only the staging result matters.
2. On staging, the option is there — but it moved, and it was renamed.
The fix adds Download as a sibling of Export, not an item inside the Export submenu (src/hooks/useSearchBulkActions.ts:2391-2397). Before the fix, Select all produced exactly one option, so the dropdown auto-flattened straight into the export submenu (useSearchBulkActions.ts:2323-2326). Now there are two options, so it no longer flattens. PR 96667's own QA step 5 says "Click Selected > Export. Observe the available export options" — following that literally lands you inside Export, where the item deliberately is not.
The gate itself cannot be what fails. Spend > Reports is literally type:expense-report (SearchSuggestionUtils.ts:172-177), so isExpenseReportType is true (useSearchBulkActions.ts:622) — and the Select-all condition is a strict subset of the per-report condition at useSearchBulkActions.ts:2718-2720. It cannot be false for Select all and true for individual selection on the same page.
3. A real latent bug: right after tapping "Select all", every bulk action can vanish.
The options memo bails out entirely when the selection map is empty, and the Select-all escape hatch only covers type:expense — not expense-report (useSearchBulkActions.ts:1933):
selectAllMatchingItems(true) only flips a flag; the rows are filled in asynchronously by the reconcile effect in SearchWriteActionsProvider. In the window before that commits — and any time a snapshot refresh momentarily empties the rows — the Reports tab falls into this early return and shows no bulk actions at all. Two of the three reported platforms are native mobile, where that window is longest. This predates PR 96667 and its unit test seeds a non-empty selection, so it never exercises this state.
What changes do you think we should make in order to solve the problem?
Retest first. On staging 9.4.92-x, Spend > Reports, as admin, with more than one page of reports (the "Select all matching" option only appears when hasMoreResults is true — SearchSelectAllMenu.tsx:40). Open the Selected dropdown and look for "Download reports" next to Export, not inside it. On a narrow window also check behind the "More" (⋯) overflow in the bulk action bar.
Fix the QA steps on PR 96667 and on this ticket to say "Download reports", and to look at the top level of the dropdown rather than inside Export.
Fix the guard at line 1933 so expense-report gets the same Select-all exemption as expense — broaden the condition to cover both types rather than hardcoding isExpenseType. Add a unit test that starts from an empty selection map with areAllMatchingItemsSelected = true on type:expense-report and asserts the actions are still built.
What alternative solutions did you explore?
The isExpenseReportSearch gate evaluating false — ruled out above; the Select-all condition is strictly weaker than the per-report one.
searchResults being stale or undefined — ruled out; isExpenseReportType comes from queryJSON, not from the Onyx snapshot, so it holds even with no snapshot.
Something filtering the option downstream — ruled out; buildResult, BulkActionBar, and ButtonWithDropdownMenu only reorder or overflow, never drop.
Missing backend support — ruled out; Web-Expensify PR 55319 shipped the jsonQuery handling this depends on. Note this is an internal repo, so verifying its deploy state needs an internal engineer.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/102084) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Activity
applause-bot commentedon Sep 23, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/13768dd26ed9d719f3d665e291a1007be301210a567504410ecbb406ec663765
MelvinBot commentedon Sep 23, 2026
Proposal
Short version: the fix for this is already on staging and, as far as the code goes, it works. The QA steps look in the wrong place and for a label that no longer exists.
What is the root cause of that problem?
There are three separate things going on. Only the third is a real defect.
1. "Reproducible in production: Yes" is expected and not evidence.
Bulk PDF export is unavailable when using Select all across reports merged 2026-09-22 20:52 UTC (merge commit
9129da6). I checked containment with the compare API:9.4.92-1-staging— contains the fix (status: ahead, behind_by: 0)9.4.91-3(production at test time) — does not contain itSo production failing is just "production doesn't have the fix yet." Only the staging result matters.
2. On staging, the option is there — but it moved, and it was renamed.
The fix adds Download as a sibling of Export, not an item inside the Export submenu (
src/hooks/useSearchBulkActions.ts:2391-2397). Before the fix, Select all produced exactly one option, so the dropdown auto-flattened straight into the export submenu (useSearchBulkActions.ts:2323-2326). Now there are two options, so it no longer flattens. PR 96667's own QA step 5 says "Click Selected > Export. Observe the available export options" — following that literally lands you inside Export, where the item deliberately is not.The label is also no longer "Download PDF". It is now "Download report" / "Download reports" (
src/languages/en.ts:470-473), renamed by [Due for payment 2026-09-28] Rename "Download as PDF" to "Download report" and add singular/plural support.The gate itself cannot be what fails. Spend > Reports is literally
type:expense-report(SearchSuggestionUtils.ts:172-177), soisExpenseReportTypeis true (useSearchBulkActions.ts:622) — and the Select-all condition is a strict subset of the per-report condition atuseSearchBulkActions.ts:2718-2720. It cannot be false for Select all and true for individual selection on the same page.3. A real latent bug: right after tapping "Select all", every bulk action can vanish.
The options memo bails out entirely when the selection map is empty, and the Select-all escape hatch only covers
type:expense— notexpense-report(useSearchBulkActions.ts:1933):selectAllMatchingItems(true)only flips a flag; the rows are filled in asynchronously by the reconcile effect inSearchWriteActionsProvider. In the window before that commits — and any time a snapshot refresh momentarily empties the rows — the Reports tab falls into this early return and shows no bulk actions at all. Two of the three reported platforms are native mobile, where that window is longest. This predates PR 96667 and its unit test seeds a non-empty selection, so it never exercises this state.What changes do you think we should make in order to solve the problem?
hasMoreResultsis true —SearchSelectAllMenu.tsx:40). Open the Selected dropdown and look for "Download reports" next to Export, not inside it. On a narrow window also check behind the "More" (⋯) overflow in the bulk action bar.expense-reportgets the same Select-all exemption asexpense— broaden the condition to cover both types rather than hardcodingisExpenseType. Add a unit test that starts from an empty selection map withareAllMatchingItemsSelected = trueontype:expense-reportand asserts the actions are still built.What alternative solutions did you explore?
isExpenseReportSearchgate evaluating false — ruled out above; the Select-all condition is strictly weaker than the per-report one.searchResultsbeing stale or undefined — ruled out;isExpenseReportTypecomes fromqueryJSON, not from the Onyx snapshot, so it holds even with no snapshot.buildResult,BulkActionBar, andButtonWithDropdownMenuonly reorder or overflow, never drop.jsonQueryhandling this depends on. Note this is an internal repo, so verifying its deploy state needs an internal engineer.Related issues
Reviewing.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/102084)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Sep 23, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (
External)melvin-bot commentedon Sep 23, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
abdulrahuman5196 commentedon Sep 26, 2026
this is not a issue, its intentionally changed to download reports
sobitneupane commentedon Sep 28, 2026
Not an issue. "Download PDF" has been renamed to "Download report". Good to close.
sobitneupane commentedon Sep 28, 2026
Requested to close.
https://expensify.slack.com/archives/C02NK2DQWUX/p1790593076064229