Skip to content

[2.1] Fixes #38296: prevent duplicate list fetches on pagination - #38472

Merged
sweta1308 merged 1 commit into
2.1from
backport/2.1/pr-38308
Nov 23, 2026
Merged

sweta1308 merged 1 commit into
2.1from
backport/2.1/pr-38308

Conversation

@gh-bot-collate

@gh-bot-collate gh-bot-collate Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Automated backport of #38308 to 2.1.

Source PR #38308
Author @Kefia-02
Merge commit 55b747a535e16193cda9bac9efd32a8ab655b101
Method Clean cherry-pick — identical to the commit on main.

Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #38308 is asked to look.

resolver run

RetriggerView in GreptileConfidence Score: 4/5

No new production failure was established, but the classification test must meet the repository’s testing requirement before merging.

Findings

  1. P2 Test bypasses the real pager ▶

Summary

Removes direct fetches from pagination handlers so existing effects send the requests.

  • List pages fetch once when someone changes the page.
  • Service lists reset to page one when their filters change.
  • Team user searches and page changes use the current paging state.
  • Bot pages fetch once and keep results from the latest request.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[User clicks Next or Previous] --> B[handlePageChange]
  B --> C[Update page and URL]
  C --> D[pagingCursor changes]
  D --> E[Existing effect fetches the page]
  E --> F[Show returned rows]
Loading

Reviews (1) · Last reviewed commit: "Fixes #38296: prevent duplicate list fet..." · Reviewed by Greptile

* 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.

---------

Co-authored-by: Sweta Agarwalla <[email protected]>
(cherry picked from commit 55b747a)
@gh-bot-collate
gh-bot-collate Bot requested a review from a team as a code owner November 23, 2026 10:36
@gh-bot-collate
gh-bot-collate Bot requested review from sweta1308 and removed request for a team November 23, 2026 10:36
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 23, 2026
@gh-bot-collate

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.1 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@sweta1308
sweta1308 merged commit c8a88b1 into 2.1 Nov 23, 2026
49 of 51 checks passed
@sweta1308
sweta1308 deleted the backport/2.1/pr-38308 branch November 23, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants