Repository navigation
Fixes #35085: Reset Incident Manager pagination when filters change - #35147
Merged
ShaileshParmar11 merged 3 commits intoOct 12, 2026
Conversation
detail-app
Bot
requested review from
ShaileshParmar11,
chirag-madlani and
karanh37
as code owners
October 10, 2026 02:16
Contributor
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Contributor
|
| Count | Rule |
|---|---|
| 2 | openmetadata-imports/no-lower-layer-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/IncidentManager/IncidentManager.test.tsx:18:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
| 🟡 | src/components/IncidentManager/useIncidentFilters.ts:20:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
Contributor
ShaileshParmar11
approved these changes
Oct 12, 2026
ShaileshParmar11
added this pull request to the merge queue
Oct 12, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 12, 2026
Contributor
🚦 Removed from the merge queue —
|
…nager-pagination-when-b853c8
Filter changes now reset currentPage to 1, so the navigate search strings include currentPage=1.
|
ShaileshParmar11
added this pull request to the merge queue
Oct 12, 2026
ShaileshParmar11
deleted the
detail/bug-fix/fixes-35085-reset-incident-manager-pagination-when-b853c8
branch
October 12, 2026 12:10
This was referenced Nov 27, 2026
Merged
ShaileshParmar11
added a commit
that referenced
this pull request
Nov 27, 2026
* [2.0] Backport #35147 and fix #38927: incident list paging 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) * test(ui): hold the old page's response in the 2.0 filter-change test 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. * refactor(ui): let usePaging drive every incident page change 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Detail bug report: View on Detail
Describe your changes:
Fixes #35085
I worked on the Incident Manager list page's URL-backed filter hook (
useIncidentFilters) because it preservedcurrentPage(and stale cursor params) verbatim across every filter mutation. When a user paginated past page 1 and then applied a narrowing filter,currentPagepointed past the new last page, so the paginator rendered an invalid "Page N of M" (N > M) with both Prev/Next enabled, and the next Prev/Next click requested an offset past the end of the smaller result set (0 rows → empty-table flash).The sibling URL-filter hooks (
useTestCaseFilters,useTestSuiteFilters) already guard against this exact failure by resettingcurrentPagetoINITIAL_PAGING_VALUEwhen a filter value actually changes; this PR mirrors them inuseIncidentFilters.Type of change:
High-level design:
N/A — small change.
In
useIncidentFilters.ts:updateFilters: detects whether any incoming filter key actually differs from the current value (isEqual); on a real change it rewrites the URL withcurrentPage = INITIAL_PAGING_VALUEand drops stalecursorType/cursorValue(undefined→ omitted byqs). Unchanged values keep the existing page, so re-selecting the same option doesn't trigger a phantom refetch. This matches the comment+logic inuseTestCaseFilters.handleSearchParam.handleDateRangeClear:omitnow also dropscurrentPage/cursorType/cursorValueso the cleared result set restarts at page 1;pageSizeand other filters (e.g.assignee) are preserved.Used
undefined(whichqsomits) rather thannull(whichqsrenders as emptycursorType=/cursorValue=params) for the cursor reset.Tests:
Use cases covered
pageSizeand other filters stay applied.cursorType/cursorValuebookmark is invalidated when a filter changes.Unit tests
openmetadata-ui/src/main/resources/ui/src/components/IncidentManager/useIncidentFilters.test.ts(+8 cases).renderWithUrlhelper that mirrors the productionfilters↔allParamsrelationship (filters = omit(allParams, ['key','title'])with numeric date coercion) so the tests exercise the real data flow that lets the stalecurrentPagepropagate. The existing test harness injectedfiltersandallParamsindependently, which masked the bug.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/.../ui/playwright/for UI changes.A relevant existing spec (
playwright/e2e/Features/IncidentManagerPagination.spec.ts) covers Next/Previous + page-size but not the paginate→filter→paginate flow that is this bug's reproduction. An analogous spec would be the ideal follow-up. I could not run the existing spec locally: it requires a running OpenMetadata backend onlocalhost:8585, and the quickstart stack couldn't start (the1.12.0-SNAPSHOTdev images aren't published —manifest unknown).Manual testing performed
/incident-manager(HTTP 200, SPA root present).1.12.0-SNAPSHOTimages returnmanifest unknownfrom the registry).updateFiltersto the pre-fix body — 5 of the new unit tests failed withExpected: "1" Received: "<stale page>"(the exact symptom from the report); revertinghandleDateRangeClearmade its dedicated test fail withReceived: "5"forcurrentPage. Restoring the fix returned all 18 to green.UI screen recording / screenshots:
Not applicable — the visible symptom ("Page N of M" with N > M) requires a seeded multi-page backend not available in this environment; the behavior is proven at the unit level by the falsification check above.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Bug fix
Automatic Fixes PRs can be configured here.