Skip to content

Fixes #39122: pass trackTotalHits so Curated Assets total isn't capped at 10,000 - #39157

Open
detail-app[bot] wants to merge 2 commits into
mainfrom
detail/bug-fix/fixes-39122-pass-tracktotalhits-so-curated-assets-19d685
Open

detail-app[bot] wants to merge 2 commits into
mainfrom
detail/bug-fix/fixes-39122-pass-tracktotalhits-so-curated-assets-19d685

Conversation

@detail-app

@detail-app detail-app Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Fixes #39122

Bug

The Curated Assets summary card on the persona-driven My Data landing page fetches its match count via the useCuratedAssets hook → searchQuery, but never passes trackTotalHits. The search backend (SearchResource.java) defaults track_total_hits to false, and the search managers (ElasticSearchSearchManager / OpenSearchSearchManager) then call trackTotalHitsUpTo(10000), capping hits.total.value at 10,000 (with relation: "gte"). The hook exposes that capped value as totalCount, so on estates with more than 10,000 matching assets the card reads "10,000 assets match the rule" (and "9,990 more assets match") instead of the true count.

Fix

Pass trackTotalHits: true in the searchQuery call inside fetchCuratedAssets, matching every other total-displaying search call in the UI (useOwnedAndFollowed, utils/queryBuilder/count.ts, Explore tree/count calls). The flag routes the request to the backend's uncapped branch (requestBuilder.trackTotalHits(true)), so hits.total.value returns the exact count.

A defensive fallback on hits.total.relation === 'gte' was intentionally not added — the explicit flag alone fixes the display, and adding fallback logic would diverge from the established pattern and add untested surface area.

Testing

  • Unit tests: Added a regression test asserting the request carries trackTotalHits: true and that a 47,000 total surfaces verbatim. It fails without the fix (Expected: true, Received: undefined) and passes with it. The full src/hooks suite (115 suites / 1018 tests) and the CuratedAssetsSummaryWidget suite (10 tests) pass — no regression.
  • Routine checks: ESLint, Prettier, organize-imports, license-header, yarn build, and pre-commit hooks (Prettier, license header, Tailwind audit, deprecation guard) all pass. yarn tsc:check reports no errors in the changed files (pre-existing errors only in unrelated ChartDetailsUtils/SSOUtils test files).
  • Backend wiring (code reading): Confirmed SearchResource.java defaults track_total_hits to false; both search managers route true → trackTotalHits(true) (uncapped) and absent/false → trackTotalHitsUpTo(MAX_RESULT_HITS=10000).
  • End-to-end (could not run): The Playwright CuratedAssets.spec.ts suite needs a running server, but the 2.0.0-SNAPSHOT images that contain the persona-driven CuratedAssets feature aren't published to the public registry, released images lack the feature, and the host has insufficient RAM (3.2 GiB) to run Elasticsearch + MySQL + server + ingestion together. The Vitest browser infra was verified separately (a targeted browser test passed 13/13 after installing Chromium + OS deps), but no My Data browser test exists today. The end-to-end guarantee is covered by the unit assertion plus the deterministic backend wiring.
  • UI recording: N/A — standalone fix, no visible UI behavior change beyond the corrected number.

Automatic Fixes PRs can be configured here.

@detail-app
detail-app Bot force-pushed the detail/bug-fix/fixes-39122-pass-tracktotalhits-so-curated-assets-19d685 branch from 9048f26 to bfb3732 Compare November 28, 2026 05:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Detail Bug] My Data: Curated Assets summary under-reports totals above 10,000

2 participants