Skip to content

Fixes 33066: Reset pagination when switching domains - #35682

Draft
Vamsi-klu wants to merge 1 commit into
open-metadata:mainfrom
Vamsi-klu:codex/fix-33066-domain-pagination
Draft

Vamsi-klu wants to merge 1 commit into
open-metadata:mainfrom
Vamsi-klu:codex/fix-33066-domain-pagination

Conversation

@Vamsi-klu

Copy link
Copy Markdown

Describe your changes:

Fixes #33066

Switching domains in the tree clears the previous domain's page and cursor position while retaining page size, filters, other query parameters and the URL fragment. Active filters are compared by serialized content so the paging reset does not rerun the domain search and reselect its first result. Standalone links to later Data Products pages retain their requested page.

Suggested reviewers

@karanh37 and @ShaileshParmar11. A maintainer must send the formal review request; the author has read access to the upstream repository.

Type of change:

  • Bug fix

High-level design:

N/A, small bug fix in the domain-selection owner. The shared pagination hook, backend search API and data models retain their existing contracts.

Tests:

Use cases covered

  • Domain A page 3 to domain B page 1, including B with one page and B with three valid pages.
  • Every recorded B list request starts at offset zero with the selected page size and B's query filter.
  • Active URL filters cannot revert a clicked domain to the first search result; changing an actual filter value still reloads the domain tree.
  • Query arrays, duplicate parameters, encoded values, pathname, hash and replacement history behavior are preserved.
  • Same/empty/all/load-more selections keep pagination. Isolated cursor parameters are removed. A switch with no position parameters leaves the URL unchanged.
  • Saved page-size preference survives a switch without an explicit URL size.
  • A standalone /domain/:fqn/data_products?currentPage=3&pageSize=25 link stays on page 3.

Unit tests

Added openmetadata-ui/src/main/resources/ui/src/components/DomainListing/components/DomainTreeView.integration.test.tsx with 15 cases using a real BrowserRouter, URL state/paging hooks, REST search conversion and tab lifecycle. The test substitutes the Tree and unrelated DomainDetails widgets; the browser tests exercise the complete application.

RED evidence was recorded before each production change: the old handler hid B's known product on a stale page; clearing paging with active parent URL filters selected A again. Both regressions pass after the fixes.

From openmetadata-ui/src/main/resources/ui:

yarn test --runInBand --watch=false --runTestsByPath \
  src/components/DomainListing/components/DomainTreeView.integration.test.tsx \
  src/components/DomainListing/components/DomainTreeView.test.tsx \
  src/components/Domain/DomainTabs/DataProductsTab/DataProductsTab.component.test.tsx \
  src/hooks/paging/usePaging.integration.test.tsx \
  src/hooks/useTableFilters.test.tsx --no-coverage

Result: 5 suites passed, 46 tests passed, 4.731 seconds. Existing duplicate-key warnings remain in the old tree test fixtures.

Coverage command:

yarn test --runInBand --watch=false --runTestsByPath \
  src/components/DomainListing/components/DomainTreeView.integration.test.tsx \
  src/components/DomainListing/components/DomainTreeView.test.tsx \
  --coverage \
  --collectCoverageFrom=src/components/DomainListing/components/DomainTreeView.tsx \
  --coverageReporters=json-summary --coverageReporters=text \
  --coverageReporters=json

Result: 29 tests passed. Whole-component coverage is 67.24% lines, 66.57% statements, 50.78% branches and 61.42% functions. This is below the 90% whole-component target. The change does not claim that the large tree component meets that target.

Backend integration tests

N/A, this issue changes no backend code or endpoint.

NOT NEEDED for this UI-only issue.

Ingestion integration tests

N/A, this issue changes no ingestion code.

Playwright (UI) tests

Added playwright/e2e/Pages/DomainDataProductsPagination.spec.ts. Real MySQL, Elasticsearch, source-built backend and optimized production UI; no feature-route mocks. API fixtures create 51 source products and one destination product. Tests cover a tree switch with active domain filters and a direct third-page link.

The final UI build passed in 30.88 seconds with NODE_OPTIONS=--max-old-space-size=4096 yarn build. Local preview on port 3001 uses the existing API proxy; only ignored generated HTML placeholders were replaced as Java normally does. Source files and production JavaScript were unchanged by that preview adaptation. Standard --project=setup --workers=1 authentication passed in 32.5 seconds and prepared all role states. The real repository sample workflow loaded 1022 source records and 1531 sink records in 1 minute 27.1 seconds; it recorded three unrelated incident Ack-transition sink errors and exited zero under its configured success threshold. The required TestDomain, TestDataProduct and nested Superset data model were each verified through HTTP 200 API responses.

PLAYWRIGHT_TEST_BASE_URL=http://localhost:3001 PW_PRESEEDED_STATE=true \
PW_TRACE=retain-on-failure yarn playwright:run \
  playwright/e2e/Pages/DomainDataProductsPagination.spec.ts \
  --project=chromium --workers=1 --max-failures=2

Final optimized-build result: 2 passed in 14.3 seconds (15.16 seconds Yarn wall time).

PLAYWRIGHT_TEST_BASE_URL=http://localhost:3001 PW_PRESEEDED_STATE=true \
PW_TRACE=retain-on-failure yarn playwright:run \
  playwright/e2e/Pages/DomainDataProductsPagination.spec.ts \
  --project=chromium --repeat-each=10 --workers=4 --max-failures=2

Final stability result: 20 passed, zero failures or retries, in 1.6 minutes (96.28 seconds Yarn wall time).

Earlier development-server evidence is retained: the initial two cases passed in 59.6 seconds before the real active-filter scenario was added. After correcting fixture authentication to reuse the existing cached admin API context, the active-filter cases passed four repeated tests with --repeat-each=2 --workers=2 in 66.9 seconds.

The first four-worker attempt was stopped after eight sign-in failures. Traces showed 401 Invalid session with an unexpired JWT. Repeated fixture logins had evicted the shared browser session under the server's five-session limit. The fixture now uses performAdminLogin(browser) and shared cached credentials.

A subsequent development-server four-worker attempt stopped with 2 navigation failures, 2 interrupted tests and 16 not run under host resource pressure. Both failures waited for the browser's full load event before any feature assertion; local module requests took about 60 seconds and traces showed no HTTP 401. Navigation now waits for domcontentloaded and then the existing positive UI and API assertions. Heavy Java and browser work were serialized and the final optimized-build stability run above passed all 20 cases. These failed attempts are not counted as passes.

The official affected-spec planner selected the three UI files in this issue. Execution uses PLAYWRIGHT_TEST_BASE_URL=http://localhost:3001, normal setup (PW_PRESEEDED_STATE=false), PLAYWRIGHT_RETRIES=0 and two workers. The generated result block below records the selected specs and actual test command.

Local Playwright run: PASSED

  • Commit: 4e57bca9ba27 (base origin/main) — uncommitted changes were present
  • Started: 2026-10-17T12:17:36.477Z · Playwright 1.57.0 · 33.7 min
  • Totals: 305 passed, 0 failed, 0 flaky, 0 skipped across 37 selected specs
Spec Reason Passed Failed Flaky Skipped
playwright/e2e/Features/Dashboards.spec.ts smoke 4 0 0 0
playwright/e2e/Features/DataProductDomainMigration.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/DataProductPersonaCustomization.spec.ts impact-mapped 2 0 0 0
playwright/e2e/Features/DataProductRename.spec.ts impact-mapped 4 0 0 0
playwright/e2e/Features/DataProductRenameConsolidation.spec.ts impact-mapped 4 0 0 0
playwright/e2e/Features/DomainFilterQueryFilter.spec.ts impact-mapped 28 0 0 0
playwright/e2e/Features/DomainIsolation/DomainDropdownIsolation.spec.ts impact-mapped 2 0 0 0
playwright/e2e/Features/DomainIsolation/DomainIncidentIsolation.spec.ts impact-mapped 2 0 0 0
playwright/e2e/Features/DomainIsolation/DomainLineageIsolation.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/DomainIsolation/DomainListingIsolation.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/DomainIsolation/DomainSearchIsolation.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/DomainIsolation/DomainTaskIsolation.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/DomainNavFilter/PersistedDomainFilter.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/DomainTierCertificationVoting.spec.ts impact-mapped 8 0 0 0
playwright/e2e/Features/Glossary/GlossaryMutualExclusivityDataProductTree.spec.ts impact-mapped 7 0 0 0
playwright/e2e/Features/LandingPageWidgets/DomainDataProductsWidgets.spec.ts impact-mapped 8 0 0 0
playwright/e2e/Features/LandingPageWidgets/DomainWidgetFilter.spec.ts impact-mapped 2 0 0 0
playwright/e2e/Features/Permissions/DataProductPermissions.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/Permissions/DomainPermissions.spec.ts impact-mapped 2 0 0 0
playwright/e2e/Features/SampleDataDomainDataProduct.spec.ts impact-mapped 3 0 0 0
playwright/e2e/Features/SearchSeparation/DomainRenamePrefixCascade.spec.ts impact-mapped 1 0 0 0
playwright/e2e/Features/Tasks/DomainFiltering.spec.ts impact-mapped 8 0 0 0
playwright/e2e/Flow/Navbar.spec.ts smoke 22 0 0 0
playwright/e2e/Pages/DataMarketplace.spec.ts smoke 5 0 0 0
playwright/e2e/Pages/DataProductAndSubdomains.spec.ts impact-mapped 18 0 0 0
playwright/e2e/Pages/DataProductCertificationFilter.spec.ts impact-mapped 4 0 0 0
playwright/e2e/Pages/DataProductODPS.spec.ts impact-mapped 10 0 0 0
playwright/e2e/Pages/DataProducts.spec.ts impact-mapped 9 0 0 0
playwright/e2e/Pages/DomainAdvanced.spec.ts impact-mapped 22 0 0 0
playwright/e2e/Pages/DomainDataProductsPagination.spec.ts changed 2 0 0 0
playwright/e2e/Pages/DomainDataProductsRightPanel.spec.ts impact-mapped 9 0 0 0
playwright/e2e/Pages/DomainUIInteractions.spec.ts impact-mapped 20 0 0 0
playwright/e2e/Pages/Domains.spec.ts impact-mapped 47 0 0 0
playwright/e2e/Pages/EntityDomainPropagation.spec.ts impact-mapped 16 0 0 0
playwright/e2e/Pages/Lineage/LineageControls.spec.ts smoke 8 0 0 0
playwright/e2e/Pages/Policies.spec.ts smoke 3 0 0 0
playwright/e2e/Pages/SubDomainPagination.spec.ts impact-mapped 1 0 0 0
playwright/e2e/auth.setup.ts setup 1 0 0 0
playwright/e2e/entity-data.setup.ts setup 1 0 0 0
playwright/e2e/entity-data.teardown.ts setup 1 0 0 0
Command
cd openmetadata-ui/src/main/resources/ui
npx playwright test playwright/e2e/Features/Dashboards.spec.ts playwright/e2e/Features/DataProductDomainMigration.spec.ts playwright/e2e/Features/DataProductPersonaCustomization.spec.ts playwright/e2e/Features/DataProductRename.spec.ts playwright/e2e/Features/DataProductRenameConsolidation.spec.ts playwright/e2e/Features/DomainFilterQueryFilter.spec.ts playwright/e2e/Features/DomainIsolation/DomainDropdownIsolation.spec.ts playwright/e2e/Features/DomainIsolation/DomainIncidentIsolation.spec.ts playwright/e2e/Features/DomainIsolation/DomainLineageIsolation.spec.ts playwright/e2e/Features/DomainIsolation/DomainListingIsolation.spec.ts playwright/e2e/Features/DomainIsolation/DomainSearchIsolation.spec.ts playwright/e2e/Features/DomainIsolation/DomainTaskIsolation.spec.ts playwright/e2e/Features/DomainNavFilter/PersistedDomainFilter.spec.ts playwright/e2e/Features/DomainTierCertificationVoting.spec.ts playwright/e2e/Features/Glossary/GlossaryMutualExclusivityDataProductTree.spec.ts playwright/e2e/Features/LandingPageWidgets/DomainDataProductsWidgets.spec.ts playwright/e2e/Features/LandingPageWidgets/DomainWidgetFilter.spec.ts playwright/e2e/Features/Permissions/DataProductPermissions.spec.ts playwright/e2e/Features/Permissions/DomainPermissions.spec.ts playwright/e2e/Features/SampleDataDomainDataProduct.spec.ts playwright/e2e/Features/SearchSeparation/DomainRenamePrefixCascade.spec.ts playwright/e2e/Features/Tasks/DomainFiltering.spec.ts playwright/e2e/Flow/Navbar.spec.ts playwright/e2e/Pages/DataMarketplace.spec.ts playwright/e2e/Pages/DataProductAndSubdomains.spec.ts playwright/e2e/Pages/DataProductCertificationFilter.spec.ts playwright/e2e/Pages/DataProductODPS.spec.ts playwright/e2e/Pages/DataProducts.spec.ts playwright/e2e/Pages/DomainAdvanced.spec.ts playwright/e2e/Pages/DomainDataProductsPagination.spec.ts playwright/e2e/Pages/DomainDataProductsRightPanel.spec.ts playwright/e2e/Pages/DomainUIInteractions.spec.ts playwright/e2e/Pages/Domains.spec.ts playwright/e2e/Pages/EntityDomainPropagation.spec.ts playwright/e2e/Pages/Lineage/LineageControls.spec.ts playwright/e2e/Pages/Policies.spec.ts playwright/e2e/Pages/SubDomainPagination.spec.ts --workers=2

The full affected run passed 305 tests with zero failed, flaky or skipped tests in 33.7 minutes. Existing Domains.spec.ts cleanup captured four HTTP 400 warning events for four classification fixtures, duplicated as eight entries in the combined reporter log. Their test assertions passed, but fixture cleanup is not claimed clean.

Manual testing performed

No human manual test session is claimed. Automated real-browser steps exercised the following:

  1. Sign in as the local admin and filter Domains to the isolated fixture prefix and Aggregate type.
  2. Open Tree view, choose A, open Data Products and page to page 3 at size 25.
  3. Choose B and open Data Products. Its known product appears on page 1; size 25 and the active filters remain.
  4. Open A's standalone third-page link and verify page 3 is retained.

UI screen recording:

A verified recording shows Orders analytics with 51 products on page 3, switching to Customer analytics with one product on page 1, with page size 25 retained. Both viewport and source capture are 1920 by 1080 at 25 fps. The H.264 MP4 is 5.6 seconds and 597228 bytes; only the leading two seconds of loading were removed from the original 7.6-second capture. Encoded frames from both demonstrated states were inspected for readability. Raw WebM and the untrimmed MP4 are retained.

Recording upload pending. The installed GitHub CLI has no attachment flag, and authenticated browser upload is unavailable in this environment.

Recorded source was based on 4e57bca9ba27732435c040fe03eb0ceb37fd0d4c, with DomainTreeView.tsx SHA256 3db90ff967da4f388b9a942aefb493c8973c4fd527e0984c946abecc20a1496a. The frontend is the optimized build of that source; the backend uses the current tested service jar, with private Docker MySQL and Elasticsearch. This is a standalone bug fix with a requested recording; the UI runs through production preview rather than a Docker UI image.

Validation limitations

The final scoped organize-imports, ESLint and Prettier sequence passed with zero errors and seven existing hook-dependency warnings in DomainTreeView. All three source/test SHA256 values were unchanged after that sequence. The repository license checker/config passed on exactly those three files. Full Playwright lint passes with zero errors and 198 existing warnings.

The full UI type check reports 560 existing diagnostics and the Playwright type check reports 115 existing diagnostics, with none attributed to the three files in this issue. Independent clean-baseline/current-source compiler comparisons matched all 613 normalized UI diagnostics exactly, including every CLI diagnostic location/code, and all 115 Playwright diagnostics exactly by file, span, code and full message. The UI comparison's additional entries are declaration-only and compiler-wrapper diagnostics. Both full-project type checks still fail on existing errors; this change introduces zero new diagnostics. The repository token audit reports 86 errors and 47 warnings in untouched CSS and Less. No styles, generated models, workflows or suppression baselines were changed to mask those results.

Checklist:

  • Read the repository contribution and UI instructions.
  • Prepared title: Fixes 33066: Reset pagination when switching domains.
  • Linked issue with Fixes #33066 above.
  • Comment explains why serialized filter contents are needed.
  • JSON Schema changes are not applicable.
  • Recording completed and verified; upload is pending as stated above.
  • Added regression and Playwright tests and listed actual results.
  • Decision check: restores existing navigation behavior; no new public contract or durable default requiring an ADR.
  • Added tests for the exact reported regression and the active-filter interaction.

@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Resetting page and cursor parameters when switching domains could discard a user's expected position and change which data products appear.

Fixes domain tree switching so pagination resets to page 1 with the selected page size and filters preserved, and standalone Data Products page links keep their requested page. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

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] Domain Tree View: Data Products tab uses stale pagination when switching domains

1 participant