Skip to content

[2.0] Backport #35147, #38945 - #38946

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

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

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #38927 on 2.0.

Backport to 2.0 of the Incident Manager pagination fix in #38945. The 2.1 backport is #38952. It also backports #35147, which 2.0 never had.

#35147, reset Incident Manager pagination when filters change: cherry-picked with conflicts.

#38945, one incident page per page change: 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 (#38927).

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

One difference from main: changing a filter while on a later page still sends two requests on 2.0, first the old page and then page 1.

Testing

  • src/components/IncidentManager and src/pages/IncidentManager Jest suites: 170 passed on this branch.
  • useIncidentManagerListPage.integration.test.tsx (new; real router, usePaging and URL filters), at 3f184d50444: 4 tests, all passed.
    • On 2.0's original hooks, the three paging tests fail.
    • With the latest-request guard removed, the late-response test and the filter-change test fail.
  • ESLint, Prettier and import sorting are clean on changed files. tsc reports no errors in the changed files.
  • No browser test, because 2.0 has no Vitest browser setup. Playwright was not run (pending).
  • Self-review against REVIEW.md: a fresh reviewer read 1e71b8b02eb and found no 🔴. I applied its 🟡 about the filter-change test in 251e599bb36. 3f184d50444 applies the same cleanup as the main PR: it drops the dead same-page refetch branch and its test, and moves a mock restore into finally.

Evidence

Jest at 3f184d50444. useIncidentManagerListPage.integration.test.tsx, useIncidentList.test.ts and useIncidentFilters.test.ts give 3 suites and 42 tests, all passed. The new integration tests:

    ✓ sends one list request for the selected page (14 ms)
    ✓ fetches the page named in the URL on first load (1 ms)
    ✓ shows the last page asked for when an earlier response arrives later (4 ms)
    ✓ shows the first page when a filter changes on a later page (3 ms)
Test Suites: 3 passed, 3 total
Tests:       42 passed, 42 total

Recordings from the main PR (#38945). These run main's code, not this branch's. The hook changes are the same here, apart from the 2.0 difference above.

  • Setup: local server, 35 incidents, page-1 responses delayed 1.5 s.
  • Before: main @ b2365bb47e0. Requests offset=15, 0, 30, 0; Page 3 of 3 lists page 1's incidents.
  • After: the fix. Requests offset=15, 30; Page 3 of 3 lists its own 5 incidents.

Before:

incident-paging-before-fix.mp4

After:

incident-paging-after-fix.mp4

Why there's no 2.0 recording: I ran this branch's UI against the same local server, which is a newer build. It stopped on the Incident Manager page with "Something went wrong: Duplicate use of selection JSON ID cell", before the list loaded. That is a version mismatch between the 2.0 UI and the newer server, not this change. A 2.0 server would be needed to record this branch.

🤖 Generated with Claude Code

Backport #35147 (reset Incident Manager pagination when filters change),
then fix the pagination race from #38927: switching pages sent a second
list request at offset 0, and 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.

(cherry picked from commit 0f7fdbf)
Release the old-offset response after page 1 answers, so the test fails
without the latest-request guard, and pin the two requests a filter
change sends on 2.0.
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.
@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner November 27, 2026 08:33
@ShaileshParmar11
ShaileshParmar11 requested review from karthicksharan and removed request for a team November 27, 2026 08:33
@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

Changing incident-list pagination and request ordering could show incidents from the wrong page or filter if transitions are mishandled.

Backports the incident list pagination fix from #38945 and the filter-reset behavior from #35147 to 2.0, so page changes send a single request for the current page and late responses from superseded requests are dropped. 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 5265d1d into 2.0 Nov 27, 2026
55 of 60 checks passed
@ShaileshParmar11
ShaileshParmar11 deleted the ShaileshParmar11/incident-list-pagination-race-2.0 branch November 27, 2026 10:01
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