Skip to content

[2.1] Backport #38945 - #38952

Merged
ShaileshParmar11 merged 3 commits into
2.1from
ShaileshParmar11/incident-list-pagination-race-2.1
Nov 27, 2026
Merged

ShaileshParmar11 merged 3 commits into
2.1from
ShaileshParmar11/incident-list-pagination-race-2.1

Conversation

@ShaileshParmar11

Copy link
Copy Markdown
Contributor

Fixes #38927 on 2.1.

Backport to 2.1 of the Incident Manager pagination fix in #38945. The 2.0 backport is #38946.

The bug: switching pages sent a second list request at offset 0, and whichever response came back last was shown. So page 3 of 3 could list page 1's incidents.

The fix:

  • filters leaves out usePaging's params.
  • One effect fetches the page at currentPage's offset.
  • Responses from superseded requests are dropped.
  • A date-range change keeps pageSize.

What was picked:

Testing

  • Jest for src/components/IncidentManager, src/components/DataQuality/TestCases and src/pages/IncidentManager: 27 suites and 325 tests, all passed on this branch.
  • useIncidentManagerListPage.integration.test.tsx (real router, usePaging and URL filters): 4 tests passed. On 2.1's original hooks, three fail: one request per page, the URL page on first load, and a late earlier response. The filter-change test passes either way.
  • ESLint and Prettier are clean on changed files. tsc reports no errors in the changed files.
  • Recordings, screenshots and the Playwright run (16 passed) are on Fixes 38927: Show the selected Incident Manager page after paging #38945, from main's code. This branch carries the same code. No Playwright run on 2.1.
  • Self-review against REVIEW.md: a fresh reviewer read c269dc5650a and found no 🔴. Its 🟡 nits, answered rather than changed so this branch stays identical to Fixes 38927: Show the selected Incident Manager page after paging #38945:
    • useIncidentList still returns fetchTestCaseIncidents, and nothing in production uses it. The same is true on main.
    • The late-response integration test could also assert that the page-2 request was sent. This is test hardening that applies to main as well.
    • useSwitchActiveDomain has its own local PAGING_URL_PARAMS, which leaves out pageSize. That code predates this change.
    • Already on 2.1, not from this change: Clear all keeps currentPage. Main fixed that in Fixes #38374: drop stale paging params from URL on Clear all #38410, which isn't on 2.1 or 2.0; it needs its own backport.

🤖 Generated with Claude Code

Switching pages in the Incident Manager sent two list requests: one for
the selected page and one at offset 0, because the page number lands in
the URL and the URL-derived filters then retriggered the fetch. Whichever
response came back last was shown, so page 3 could list page 1's rows.

Leave usePaging's params out of the filters, fetch from a single effect
keyed on the current page, and drop responses from superseded requests.
A date-range change keeps the page size in the URL.

Fixes #38927

(cherry picked from commit 300a6a8)
NextPrevious only asks for the next or previous page, so the same-page
refetch branch in handlePagingClick was unreachable. Drop it and its
tests, and restore the usePaging mock in a finally block so a failing
assertion cannot leak currentPage 3 into later tests.

(cherry picked from commit 1c7e744)
2.1 has no Vitest browser setup, so the browser test cannot run there.
The Jest integration test covers the same paging behaviour.
@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner November 27, 2026 09:43
@ShaileshParmar11
ShaileshParmar11 requested review from shrabantipaul-collate and removed request for a team November 27, 2026 09:43
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

The localized incident-pagination change alters request timing and stale-response handling, which could affect which incidents appear on the selected page.

Backports the Incident Manager pagination fix to 2.1 by cherry-picking two commits that fetch one incident page per page change and drop superseded responses, so page 3 can no longer show page 1's incidents. The incident browser test is dropped because 2.1 has no Vitest browser setup. 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

@ShaileshParmar11
ShaileshParmar11 merged commit 46b38f1 into 2.1 Nov 27, 2026
44 of 45 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the ShaileshParmar11/incident-list-pagination-race-2.1 branch November 27, 2026 10:02
This was referenced Nov 27, 2026
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.

2 participants