Skip to content

fix(client): use backend connection filters - #3294

Open
tju-yxq wants to merge 1 commit into
apache:rocketmq-studiofrom
tju-yxq:codex/client-connections-server-filters
Open

fix(client): use backend connection filters#3294
tju-yxq wants to merge 1 commit into
apache:rocketmq-studiofrom
tju-yxq:codex/client-connections-server-filters

Conversation

@tju-yxq

@tju-yxq tju-yxq commented Sep 5, 2026

Copy link
Copy Markdown

What changed

The Client Connections page now forwards the selected cluster and client type to the existing backend query parameters instead of loading every connection and filtering only in the browser.

  • send clusterId and type when a concrete filter is selected;
  • reset pagination when a filter changes;
  • calculate statistics, diagnostics, table rows, and exports from the filtered response;
  • keep all clusters from the registry in the cluster selector so filtering one response does not make other clusters disappear;
  • add regression coverage for combined filter requests and server-filtered statistics.

Why

On installations with many connections, the page could request and render the complete inventory even when an operator had selected a cluster or type. The displayed totals and exported data also depended on the client-side copy rather than the backend result. This makes the existing filters useful for large deployments and preserves the ability to switch back to another registered cluster after filtering.

Closes #3291

Validation

  • npm test -- ClientsPage.test.tsx --run — 19 tests passed
  • npm run lint -- --quiet — 0 errors; 10 existing warnings remain elsewhere in the tree
  • npm run build — passed
  • git diff --check — passed

The repository's CI status is not being described here; the validation above is from the local branch.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR optimizes the Client Connections page by moving cluster and type filtering from client-side to server-side, improving performance for large deployments.

Key Changes:

  • Sends clusterId and type filters to backend API instead of filtering in browser
  • Adds type filter dropdown (Producer/Consumer)
  • Resets pagination when filters change
  • Cluster selector now preserves all registry clusters (not just from current response)
  • Statistics and exports now based on filtered backend response

Implementation Quality:

  • Clean separation of concerns (filters sent as query params)
  • Proper dependency array updates in useEffect/useMemo hooks
  • Good test coverage for combined filter scenarios
  • Maintains UX by preserving cluster options from registry

No blocking issues found. This is a solid performance optimization with proper implementation.


Automated review by github-manager-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants