Repository navigation
[2.0] Backport #35147, #38945 - #38946
Conversation
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.
❌ 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 riskChanging 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 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.0.Backport to
2.0of the Incident Manager pagination fix in #38945. The2.1backport is #38952. It also backports #35147, which2.0never had.#35147, reset Incident Manager pagination when filters change: cherry-picked with conflicts.
useIncidentFilters.ts: only the imports conflicted.useIncidentFilters.test.ts: I kept both 2.0's tests and Fixes #35085: Reset Incident Manager pagination when filters change #35147's.IncidentManager.test.tsx: I kept 2.0's version. Fixes #35085: Reset Incident Manager pagination when filters change #35147's changes to it target main's newer UI, and 2.0's assertions still pass withcurrentPage=1in the URL.#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).
filtersleaves out usePaging's params.currentPage's offset.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.usePagingcopies the page from the URL in an effect, one render late. Main changed that in Fixes 35468: Standardize UI pagination: 15/25/50 for lists, 12/24/48 for card grids #35288, which is too large to backport.Testing
src/components/IncidentManagerandsrc/pages/IncidentManagerJest suites: 170 passed on this branch.useIncidentManagerListPage.integration.test.tsx(new; real router,usePagingand URL filters), at3f184d50444: 4 tests, all passed.tscreports no errors in the changed files.2.0has no Vitest browser setup. Playwright was not run (pending).REVIEW.md: a fresh reviewer read1e71b8b02eband found no 🔴. I applied its 🟡 about the filter-change test in251e599bb36.3f184d50444applies the same cleanup as the main PR: it drops the dead same-page refetch branch and its test, and moves a mock restore intofinally.Evidence
Jest at
3f184d50444.useIncidentManagerListPage.integration.test.tsx,useIncidentList.test.tsanduseIncidentFilters.test.tsgive 3 suites and 42 tests, all passed. The new integration tests: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.main@b2365bb47e0. Requestsoffset=15, 0, 30, 0; Page 3 of 3 lists page 1's incidents.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