unbridled-41 opened a new issue, #4008: URL: https://github.com/apache/rocketmq-dashboard/issues/4008
## Problem Navigating between the two alert-rule pages (告警规则 `/ops/alerts` ↔ 业务告警规则 `/ops/business-alerts`) reuses the previous page's pagination, search and status filter, producing an empty or silently narrowed rule list on the destination page. ## Evidence Both routes render the same `AlertsPage` component without a key (`web/src/App.tsx:187-188`), so React Router preserves the component instance — and its state — across navigation between the two primary menu entries (`web/src/layouts/MainLayout.tsx:204,218`). `page`, `search` and `enabledFilter` (`web/src/pages/ops/alerts.tsx:159-162`) are never reset when the `domain` prop changes; the list effect re-fetches with the retained values. Reproduction (deterministic): on 告警规则, page to page 2 with 21+ rules (or type a search term), then click 业务告警规则. The business list is fetched with `page: 2` and the retained search; out-of-range pages slice to `items: []` with `total` unchanged, so the table is empty while the pagination control clamps its displayed page to 1 — it looks like no business rules exist. A retained search silently narrows the other domain's list. ## Impact A primary navigation path shows an empty or filtered rule list that does not correspond to the destination page's own filters; operators can conclude that business rules are missing. ## Expected behavior Switching domains loads the destination domain from a clean state: page 1, no search, no status filter, no stale row selection. ## Related work #2430 (closed) reset inventory pagination when filters shrink results on the same page family; the domain switch is the remaining path that leaves stale list state. #2570/#2589 cover different create/pagination defects. ## PR #4004 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
