Skip to content

Download PDF option is not available when bulk selecting reports as admin #102084

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


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:

  1. Open App as admin
  2. Go to spend > reports
  3. Bulk select all reports
  4. 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

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7267132_1790161770400.ScreenRecording_09-23-2026_16-04-03_1.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7267132

Issue OwnerCurrent Issue Owner: @sobitneupane

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 23, 2026
  2. applause-bot commented on Sep 23, 2026

    @applause-bot
    Author

    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

  3. MelvinBot commented on Sep 23, 2026

    @MelvinBot
    Contributor

    Proposal

    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.

    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 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 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), 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):

    if ((selectedTransactionsKeys.length === 0 && !(isExpenseType && areAllMatchingItemsSelected)) || !hash) {

    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?

    1. 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.
    2. 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.
    3. 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.
    Related issues

    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

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 23, 2026
  5. melvin-bot commented on Sep 23, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

  6. melvin-bot commented on Sep 23, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  7. abdulrahuman5196 commented on Sep 26, 2026

    @abdulrahuman5196
    Contributor

    this is not a issue, its intentionally changed to download reports

  8. sobitneupane commented on Sep 28, 2026

    @sobitneupane
    Contributor

    Not an issue. "Download PDF" has been renamed to "Download report". Good to close.

  9. sobitneupane commented on Sep 28, 2026

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions