Repository navigation
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
This comment has been minimized.
This comment has been minimized.
Services, Team users, Applications, Marketplace and Database schema version fetched the page in their Next/Previous handler and again in the pagingCursor effect. Keep the effect as the single fetch path, and add a Bots regression test asserting one request per page change.
…ationDetails effect complexity Services and Team users still fetched in their search-mode page handler while the pagingCursor effect also fired (currentPage is part of the cursor): Services re-searched page 1, Team users reloaded the unfiltered team list. Make the effect the single fetch path for search paging too, and add regression tests. Move the page-1 check out of the ClassificationDetails effect so it is back under the ESLint complexity limit that failed ui-checkstyle.
…r changes The search effect now pages by the URL page number, so a filter change that kept the previous page searched that page of the new filter and could land on an empty page. Reset page and cursor when the service-type filter value changes (not on sort) and when Show deleted is toggled, matching the search handler.
A service-type filter change can commit its local page reset before the URL cursor catches up. Skip that transient mismatch so the old page is never searched and cannot race the replacement page-1 response. Keep the existing cursor effect as the single fetch path and preserve all preceding maintainer changes. Add a real-router regression that starts on page 2 with a cursor, selects Airbyte in the actual type filter, checks that only page 1 is requested, and verifies the matching service remains visible and the old cursor is cleared. The regression fails at dc695ed (page 2) and at 513a3c1 (requests for pages 2 and 1). With this fix, 70 tests across Services, Services paging, UserTab and ClassificationDetails pass locally. All 14 PR source files pass organize-imports, ESLint, Prettier and license-header checks. Node 22.23.5; no paid runner or service used.
…and Bots React Router applies URL paging resets in a transition, so a filter or search change can render (and fetch) once with the old page or cursor before the reset lands. Both requests then race and the older response could win. Track the latest request in each list fetch and ignore results, errors and loading state from superseded ones. Regression tests resolve the stale request last.
Wait for the URL paging cursor to match the local currentPage before fetching team users. Search using that synchronized page while keeping the latest-request response guard. Add real-router regressions for starting a search from page 2 and clearing a search on page 2. Before the fix these issue search pages [2, 1] and two unfiltered requests; after the fix each sends one request for page 1. Exercise stale-response protection with two distinct searches instead of depending on an unwanted stale-page request. Validation: all 17 UserTab tests pass, with no failures or skips. Both new regressions fail against parent 5504a77. Organize imports, ESLint and Prettier pass for the two changed files. Addresses the UserTab finding in PR open-metadata#38308 review 6018797346.
Toggle Show deleted from page 1 with a before cursor so the stale-cursor request resolves last, and assert the newer deleted list stays rendered. Fails without the guard in fetchBots.
ShaileshParmar11
left a comment
There was a problem hiding this comment.
UI review at 76a5e25. The fix looks right, and I'd merge it once the ClassificationDetails change has a regression test (inline).
What I checked:
- Every one of the nine pages whose handler fetch was deleted already has a
pagingCursoreffect that fetches, so no page is left without a fetch path. usePagingmemoizespagingCursoron primitive values, so a reset to the same page does not re-run effects. That is what makes theisPagedPastFirstPagechange necessary.- The page-mismatch skip in the Services and UserTab effects means a search or filter reset from a later page sends one request, not two.
- Both earlier bot findings (first Next lost after switching classification; UserTab double search) are fixed on this head.
- Locally on this head,
BotListV1.component.test.tsx,Services.paging.test.tsx,UserTab.test.tsxandClassificationDetails.test.tsxall pass (55 tests).
The playwright job was skipped on this PR.
Switching classification on page 1 leaves the URL unchanged, so the skip flag must not be set or the next Next click sends no request. Exercise it with real navigation and a Next button in the TableV2 mock, in its own file because the existing suite stubs useNavigate. Fails with the flag forced to true.
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findingsRouting pagination and search requests through URL-driven effects across eleven lists could change which page data users see after filter or search updates. Removes duplicate list fetches on pagination across eleven cursor-paginated pages by keeping a single fetch path in the URL paging cursor effects, and ignores superseded responses in Services, Team users and Bots. Resolved the lost first Next click after switching classification in Classification tags and the duplicate search requests from a later page in UserTab search. No open issues found. ✅ 2 closed✅ Bug: Classification tags: first Next click after switching classification is lost
✅ Performance: UserTab search from a later page still fires two list requests
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
ShaileshParmar11
left a comment
There was a problem hiding this comment.
Approving at 26a4520. The new ClassificationDetails.paging.test.tsx passes on this head and fails with isClassificationChangingRef.current = true; (Number of calls: 0), so it guards the fix. The BotListV1, Services.paging, UserTab and ClassificationDetails suites also pass locally (56 tests in all).
Optional cleanup, not blocking: the new file copies almost all of the mocks from ClassificationDetails.test.tsx, but this test only needs four (useEntityRules, rest/tagAPI, rest/miscAPI and TableV2). With only those, it still passes and still fails without the fix, and the file drops from 365 to 166 lines.
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
…38472) * fix(ui): fetch paginated lists only in URL cursor effects (#38296) * fix(ui): fetch paginated lists only in URL cursor effects (#38296) * fix(ui): fetch paginated lists only in URL cursor effects (#38296) * fix(ui): fetch paginated lists only in URL cursor effects (#38296) * fix(ui): fetch paginated lists only in URL cursor effects (#38296) * fix(ui): fetch paginated lists only in URL cursor effects (#38296) * fix(classification): do not suppress first pagination fetch after page-1 switch * fix(ui): drop duplicate page fetch from remaining cursor paging handlers Services, Team users, Applications, Marketplace and Database schema version fetched the page in their Next/Previous handler and again in the pagingCursor effect. Keep the effect as the single fetch path, and add a Bots regression test asserting one request per page change. * fix(ui): page search results through the cursor effect; cap ClassificationDetails effect complexity Services and Team users still fetched in their search-mode page handler while the pagingCursor effect also fired (currentPage is part of the cursor): Services re-searched page 1, Team users reloaded the unfiltered team list. Make the effect the single fetch path for search paging too, and add regression tests. Move the page-1 check out of the ClassificationDetails effect so it is back under the ESLint complexity limit that failed ui-checkstyle. * fix(ui): reset Services paging when the service-type or deleted filter changes The search effect now pages by the URL page number, so a filter change that kept the previous page searched that page of the new filter and could land on an empty page. Reset page and cursor when the service-type filter value changes (not on sort) and when Show deleted is toggled, matching the search handler. * fix(ui): wait for the reset cursor before fetching filtered services A service-type filter change can commit its local page reset before the URL cursor catches up. Skip that transient mismatch so the old page is never searched and cannot race the replacement page-1 response. Keep the existing cursor effect as the single fetch path and preserve all preceding maintainer changes. Add a real-router regression that starts on page 2 with a cursor, selects Airbyte in the actual type filter, checks that only page 1 is requested, and verifies the matching service remains visible and the old cursor is cleared. The regression fails at dc695ed (page 2) and at 513a3c1 (requests for pages 2 and 1). With this fix, 70 tests across Services, Services paging, UserTab and ClassificationDetails pass locally. All 14 PR source files pass organize-imports, ESLint, Prettier and license-header checks. Node 22.23.5; no paid runner or service used. * fix(ui): apply only the newest list response in Services, Team users and Bots React Router applies URL paging resets in a transition, so a filter or search change can render (and fetch) once with the old page or cursor before the reset lands. Both requests then race and the older response could win. Track the latest request in each list fetch and ignore results, errors and loading state from superseded ones. Regression tests resolve the stale request last. * fix(ui): avoid duplicate team requests during search page resets Wait for the URL paging cursor to match the local currentPage before fetching team users. Search using that synchronized page while keeping the latest-request response guard. Add real-router regressions for starting a search from page 2 and clearing a search on page 2. Before the fix these issue search pages [2, 1] and two unfiltered requests; after the fix each sends one request for page 1. Exercise stale-response protection with two distinct searches instead of depending on an unwanted stale-page request. Validation: all 17 UserTab tests pass, with no failures or skips. Both new regressions fail against parent 5504a77. Organize imports, ESLint and Prettier pass for the two changed files. Addresses the UserTab finding in PR #38308 review 6018797346. * test(ui): cover the Bots latest-request guard on a deleted toggle Toggle Show deleted from page 1 with a before cursor so the stale-cursor request resolves last, and assert the newer deleted list stays rendered. Fails without the guard in fetchBots. * test(ui): cover the first Next after switching classification on page 1 Switching classification on page 1 leaves the URL unchanged, so the skip flag must not be set or the next Next click sends no request. Exercise it with real navigation and a Next button in the TableV2 mock, in its own file because the existing suite stubs useNavigate. Fails with the flag forced to true. --------- (cherry picked from commit 55b747a) Co-authored-by: Kefia-02 <[email protected]> Co-authored-by: Sweta Agarwalla <[email protected]>
) Manually adapt main merge 55b747a to the 2.0 Ant Design views and retain inherited team-user search/export behavior. Keep URL-driven effects as the single fetch path in eleven cursor-paginated lists; preserve search/filter resets and latest-response guards. Add 2.0 regressions with the real table/pager for classification and the real marketplace pager, and account for the separate bot-map load. Validation: 13 relevant suites / 105 unique tests pass using the normal 2.0 Jest configuration. Six selected regressions fail on unchanged base 8e6938f. Restoring the old page-1 classification skip also fails its regression. Core components build, schema/ANTLR generation, all 16 changed-file UI checkstyle checks, and git diff --check pass.
… tests (#38651) #38309 and #38308 fixed the Data Models / Stored Procedures page reset and the duplicate fetch on page change, so the browser tests no longer need the knownIssues escape hatch: the single-fetch assertion in paginationContract is now unconditional, the option is removed, the four Playwright tests for those tabs are tagged @migrated-browser again, and PAGINATION_MIGRATION.md reflects 35 tagged / 4 untagged. Co-authored-by: Claude Opus 5.5 <[email protected]>
Problem
Eleven cursor-paginated lists issue the same page request twice. Their page-change handler invokes a fetch and then changes the URL paging cursor; the URL-driven
pagingCursoreffect issues an identical second fetch.Affected: Roles, Policies, Bots, Notification alerts, Classification tags, Service version, Services, Team users, Applications, Marketplace, Database schema version.
Change
pagingCursoreffects, which already handle first load, restored URLs, page-size changes and reloading.currentPageis part ofpagingCursor, so the old handler fetch raced a second effect request: Services re-searched page 1, Team users reloaded the unfiltered team list. The effect now passes the URL page number to the search.showDeleted = false, so in deleted mode it raced the effect's deleted-bots request; only the effect's request remains.Fixes #38296.
Verification
BotListV1 › fetches the next page exactly once when Next is clicked(real router, real Next button): passes on this branch, fails against the pre-fix component with two identicalafterrequests.Services search paging › fetches the next search page once, at the requested page numberandUserTab › Search paging › fetches the next search page once and does not reload the unfiltered team list: pass on this branch, fail against the previous handlers (Services searched withcurrentPage: undefined; Team users calledgetUsers).Services search paging › returns to page 1 when the deleted filter changes on a later search page: passes on this branch, fails without the reset.Services overlapping list requests › keeps the newest deleted list when the stale-cursor request resolves lastandUserTab › Search paging › keeps the newest search results when an older search resolves last: pass on this branch, fail without the request guard.BotListV1 › keeps the newest deleted bots when the stale-cursor request resolves last: passes on this branch, fails without the guard infetchBots.ClassificationDetails.paging.test.tsx › fetches the next page after switching classification on page 1: passes on this branch, fails with the skip flag forced totrue(Number of calls: 0).ClassificationDetails: the page-1 check moved out of the tag-loading effect to keep it under the ESLint complexity limit (ui-checkstyle).5ff7b76f: focused verification, dependency-based run.duplicateFetchOnPageChangein the unmerged Fixes #37219: Vitest browser-mode UI integration tests (Pagination migration, marked) + CI #35623 should have theirknownIssuesmarkers removed once it lands.Prepared with AI assistance.


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
The PR removes duplicate page requests from eleven lists by letting URL-driven effects fetch each page.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[User clicks Next or Previous] --> B[Handler updates URL paging] B --> C[Paging effect fetches requested page] C --> D[Page displays results]Reviews (17) · Last reviewed commit: "test(ui): cover the first Next after swi..." · Reviewed by Greptile