btlqql opened a new pull request, #7138:
URL: https://github.com/apache/rocketmq-dashboard/pull/7138
### Which Issue(s) This PR Fixes
- Fixes #6086
## What is the purpose of the change
`web/src/pages/cluster/clients.tsx` offered a connection time in three
places — the table's
"Heartbeat" column, the CSV export's "Connected At" column and the
connection detail dialog — all
bound to `ClientConnectionVO.connectedAt`, a field that no provider ever
assigns:
`RocketMQClientProvider.toConnectionVO(ProducerInfo, ...)` and
`toConnectionVO(Connection, ...)`
build the VO from `ProducerInfo` / `Connection` payloads that carry no
timestamp, and the proxy
branch passes none either. Every cell therefore rendered `-`, which reads as
"this client never
sent a heartbeat" rather than "this build does not collect it".
Both resolutions the issue allows were considered. Populating the field is
not possible from data
that exists: the broker-side `ProducerInfo` / `Connection` objects carry a
client id, an address, a
version and a language, but no connect or heartbeat timestamp, and the proxy
consumer list does not
either — computing one would mean inventing it, which is exactly what #5600
refused to do when it
dropped the fabricated NameServer "Connections" column. So the page stops
advertising the
information: the table column (and its sorter), the CSV field and the dialog
row are gone, and the
existing CSV/dialog expectations are trimmed to the columns the API really
fills.
`ClientConnectionVO.connectedAt` itself is left alone in this PR on purpose.
Deleting it would drag
the web `ClientConnection` type, the mock fixtures and the
`INVALID_CONNECTION_TIME` diagnostic rule
(which no real payload can reach, because the field is always null) into the
same diff, and after
this change none of them is rendered. They are dead code rather than a claim
shown to the operator;
removing them is a cleanup for a follow-up PR if you want it.
## Brief changelog
- `web/src/pages/cluster/clients.tsx`: drop the "Heartbeat" table column
with its sorter, the
`Connected At` CSV export column and the connection detail row; drop the
`formatDateTime` import
that only that column used.
- `web/src/pages/cluster/__tests__/ClientsPage.test.tsx`: add a regression
test asserting that no
connection-time control survives (table header, detail dialog, CSV
header); update the CSV export
and detail-dialog expectations to the columns the page now renders.
## Verifying this change
- red: `cd web && npx vitest run
src/pages/cluster/__tests__/ClientsPage.test.tsx` (new test only, on
unmodified trunk) →
`AssertionError: expected [ <span …(1)></span>, …(1) ] to have a length of
+0 but got 2` at
`ClientsPage.test.tsx:914:43`, summary `Tests 1 failed | 26 passed (27)`
(log: `6086-clients-red.log`)
- green: same command after the change → `Test Files 1 passed (1)`,
`Tests 27 passed (27)` (log: `6086-clients-green.log`)
- regressions run: `npx vitest run
src/utils/clientConnectionDiagnostics.test.ts src/api/connections.test.ts`
→ `Test Files 2 passed (2)`, `Tests 9 passed (9)`; `npx tsc -b` → exit 0
(logs: `6086-neighbours.log`, `6086-tsc.log`)
Not run: the full `web` suite, `npm run lint`, the server suite (no server
file changed), CI, and
nothing was checked against a live RocketMQ cluster.
## Checklist
- [x] one issue, one PR: Fixes #6086
- [x] regression test added, red on trunk and green after the change
- [x] targeted suites re-run (`ClientsPage.test.tsx`,
`clientConnectionDiagnostics.test.ts`, `connections.test.ts`, `tsc -b`)
- [x] one coherent change, two files, no unrelated edits
- [ ] full `npm test` — not run (out of scope for this campaign)
--
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]