apache / apache/rocketmq-dashboard
[Studio][Bug] Switching NameServers on the Clients page keeps the previous endpoint column filters
- Dominant language
- Java
- Stars
- 1.4k
- Forks
- 683
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 58
Description
## Problem
On the Client Connections page, switching the NameServer endpoint keeps the previous endpoint's table column filters active. The columns use uncontrolled antd filters (`filters` + `onFilter` with no `filteredValue`), and `handleNameserverChange` resets `connections`, `clusterFilter`, and the selected row — but neither the `columnFilters` export mirror nor antd's internal filter state.
## Evidence
- `web/src/pages/cluster/clients.tsx` `handleNameserverChange` resets `currentPage`, `selectedEndpoint`, `connections`, `clusterFilter`, `selectedConnection`, `loadError`, `loading` — but not `columnFilters` (state declared as `useState({})`).
- The clusterName / type / protocol / language columns declare `filters` + `onFilter` without a controlled `filteredValue`, so antd keeps its internal filter selection across `dataSource` changes.
- `columnFilters` is only written by the table `onChange` handler and consumed by `exportConnections`, which drives both the export CSV and the Export button's disabled state.
Reproduction: on NameServer A, filter the type column to `Consumer` (or pick a cluster name), then switch the NameServer select to endpoint B whose rows have different cluster names/types. After the new load finishes, the table shows no rows and the stats header reports 0 connections, while the new endpoint's data was fetched; the Export button stays disabled.
## Impact
An operator switching between NameServer endpoints silently sees an empty client list and cannot export, because filters scoped to the previous endpoint are still applied to the new rows. The state must be manually discovered and cleared to see the real data.
## Expected behavior
Endpoint-scoped column filters are cleared when the NameServer changes: the new endpoint's rows render immediately and the export matches the unfiltered (search + cluster-select) view.
## Related work
- #3291 (closed) covered the backend ignoring cluster/type filters — a different defect on the same page.
- The registry/preview/diff guards on the cluster pages (#3151, merged #3154) follow the same "invalidate per-scope state when the scope changes" principle.
## PR
Fix: #4240.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in web/src/pages/cluster/clients.tsx, focusing on handleNameserverChange, the columnFilters state, and the clusterName, type, protocol, and language columns. Trace the table onChange handler and exportConnections behavior. Done means changing NameServer clears endpoint-scoped filters, displays the new endpoint's rows, and enables an export matching the unfiltered view.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100