Repository navigation
[2.1] Backport #38945 - #38952
[2.1] Backport #38945#38952
Conversation
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.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
Code Review ✅ Approved 🟡 Medium riskThe 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 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 |
Fixes #38927 on
2.1.Backport to
2.1of the Incident Manager pagination fix in #38945. The2.0backport 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:
filtersleaves out usePaging's params.currentPage's offset.pageSize.What was picked:
300a6a8015eand1c7e7448dce.2.1already has Fixes #35085: Reset Incident Manager pagination when filters change #35147 (page reset on filter change) and main's newerusePaging, so the code matches main and, unlike2.0, a filter change sends one request.c269dc5650a, dropsIncidentManagerPage.browser.test.tsx.2.1has no Vitest browser setup. The Jest integration test covers the same paging behaviour.Testing
src/components/IncidentManager,src/components/DataQuality/TestCasesandsrc/pages/IncidentManager: 27 suites and 325 tests, all passed on this branch.useIncidentManagerListPage.integration.test.tsx(real router,usePagingand URL filters): 4 tests passed. On2.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.tscreports no errors in the changed files.main's code. This branch carries the same code. No Playwright run on2.1.REVIEW.md: a fresh reviewer readc269dc5650aand 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:useIncidentListstill returnsfetchTestCaseIncidents, and nothing in production uses it. The same is true on main.useSwitchActiveDomainhas its own localPAGING_URL_PARAMS, which leaves outpageSize. That code predates this change.2.1, not from this change: Clear all keepscurrentPage. Main fixed that in Fixes #38374: drop stale paging params from URL on Clear all #38410, which isn't on2.1or2.0; it needs its own backport.🤖 Generated with Claude Code