iloveeyjafjalla opened a new pull request, #6321:
URL: https://github.com/apache/rocketmq-dashboard/pull/6321
Fixes #6320
### What
The client-connection summary tiles no longer de-duplicate by client.
`web/src/pages/cluster/clients.tsx` built `connectionStats` from a `Map` keyed
by `${type}:${clientId}`, so the tile labelled 客户端连接 (the same string as the
page title) counted de-duplicated clients while the page subtitle, the table
footer and the table itself count connections. The value it produced was
neither: a client that registers as both a producer and a consumer (the STREAM
client in the reproduction) was counted twice.
The tiles now describe the rows the table lists. The de-duplicated view is
unchanged and still lives in the diagnostics panel (唯一 Client / 唯一地址).
### Why it mattered
Reproduced against a stock Apache RocketMQ 5.3.2 broker (Direct mode, single
broker `broker-a`), seven real connections:
| where | value |
|---|---|
| page subtitle / table footer / table rows | `7 connections` / `共 7` / 7
rows |
| tiles before | 客户端连接 5, Producer 4, Consumer 1, `Remoting: 5`, `Java
V5_5_0: 5` |
| tiles after | 客户端连接 7, Producer 6, Consumer 1, `Remoting: 7`, `Java
V5_5_0: 7` |
| diagnostics (unchanged) | `唯一 Client: 4`, `唯一地址: 4` |
`mqadmin producerConnection` for the same clients reports 4 + 1 + 1 = 6
producer connections, which is what the table lists. Mock mode never showed the
divergence because its fixture has 15 connections over 15 distinct clients.
### How did you test this change?
- `npx vitest run src/pages/cluster/__tests__/ClientsPage.test.tsx`: 25/25
green. The new case
`countsEveryListedConnectionWhenAClientServesSeveralGroupsTest` fails on the
previous code (the tile shows 2 where the table has 3 rows) and asserts that
the diagnostics panel still reports the two unique clients and addresses.
- `npm run lint`: 0 errors (10 pre-existing warnings in untouched files).
- `npx tsc -b`, `npx vite build`, `npm run license:check`: pass (133
components, 140 license files).
- Re-checked on the live broker described above: tiles 7 / 6 / 1 /
`Remoting: 7`, header and footer unchanged at 7.
### Checklist
- [x] One coherent fix and its tests
- [x] Conventional Commit subject
- [x] Test name ends in `Test`
- [x] New UI text: N/A
- [x] Java architecture/integration tests: not run, no backend change
- [x] Existing ASF headers retained; no new source file
AI assistance: prepared with AI assistance (OpenAI Codex / ZCode) from a
real-broker reproduction; every number above was read back from the running
stack before it was written down.
--
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]