unbridled-41 commented on PR #4951:
URL:
https://github.com/apache/rocketmq-dashboard/pull/4951#issuecomment-5777453323
Evidence-chain audit, re-executed from a clean worktree of this branch
(`88b84ec1`).
**Citations re-read with `grep -n` against `1ef5d860` and against this
branch**
`ConsumerConnections.java:33-43` (only `clientId` + `address`),
`ConsumerInstanceVO.java:33-40`, `consumer.tsx:1177` (the 协议 header) /
`:1181-1184` (its render) / `:2008-2013` (the verdict),
`consumerGroupDiagnostics.ts:135-138,324,431-432`, `constants/theme.ts:66-69`
(only `Remoting`/`gRPC`), `metadata.ts:115-122`. All present as described; the
`LangContext` citation was corrected to `:39` before this audit.
`grep -rn "setLastHeartbeat\|setProtocol(" server/src/main/java` was re-run:
the only `protocol(...)` hits are `RocketMQClientProvider.java:331,413`, which
build the clients-page VO. Neither field has a writer on `ConsumerInstanceVO`,
so both are always absent from the response.
**Pre-fix failures re-demonstrated**
With `consumer.tsx` restored to `1ef5d860` and the tests kept:
```
TestingLibraryElementError: Unable to find an element with the text: 不可用.
(the protocol cell)
TestingLibraryElementError: Unable to find an element with the text:
客户端未上报心跳时间. (the card, with the first assertion removed)
```
**Test gap found and closed** (`test(consumer)` commit `88b84ec1`)
The fix splits the health card's verdict into three states, and nothing
asserted that the healthy one survives the split — the new branch could have
taken the healthy case over silently. Added `still grades a group healthy when
the reported heartbeat is fresh`: a recent `lastHeartbeat` keeps 心跳状态正常 and
does not show the not-reported label. It passes on the old code as well (there
the healthy label was the terminal `else`), so it is a guard, and it is not
vacuous: collapsing the new branch to the not-reported label makes it fail with
`Unable to find an element with the text: 心跳状态正常.`
**Commands re-run**
```
npx vitest run src/pages/instance/__tests__/ConsumerPage.test.tsx → 38/38
npx vitest run src/pages/instance src/utils src/services → 40
files, 396/396
npx tsc --noEmit → clean
npx eslint consumer.tsx ConsumerPage.test.tsx api/metadata.ts → clean
```
**Coverage statement**
Both halves of the finding are covered by one test, which fails on the old
code for each half in turn; the healthy verdict the split must preserve is
covered by the new test; the 最后心跳 column is deliberately untouched
(`formatDateTime` already renders `-` for a missing value, which asserts
nothing).
--
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]