unbridled-41 opened a new pull request, #4883:
URL: https://github.com/apache/rocketmq-dashboard/pull/4883
## Problem / Evidence
In the topic detail modal's consumer table, the 消费模式 (consume mode) tag
color compared the cell value against the mock fixture's Chinese literal:
```tsx
render: (m: string) => <Tag color={m === '广播消费' ? 'orange' :
'blue'}>{m}</Tag>
```
The real API never sends that string:
- Apache provider: `messageModel = conn.getMessageModel().name()` →
`CLUSTERING` / `BROADCASTING` (and the offline fallback hardcodes
`"CLUSTERING"`) — `RocketMQMetadataProvider.java`
- Aliyun converter: passes the raw cloud `messageModel`
(`Broadcasting`-style) — `AliyunConverters.java`
- The Chinese literals exist only in `web/src/mock/topics.ts`
So in every non-mock deployment the orange branch is dead code: broadcasting
consumer groups always render with the default blue tag, and the color contract
silently differs between mock mode and production.
Reproduced by a regression test: a `BROADCASTING` consumer row in the detail
modal rendered a blue tag before the fix; it now renders orange.
## Root cause / Fix
Display logic written against mock fixture values instead of the API
contract. The tag now colors orange for any broadcast-spelled value,
case-insensitively (`/broadcast/i`), which covers `BROADCASTING`,
`Broadcasting`, and the mock's own label, and keeps the raw cell text unchanged.
## Priority / scoring
PRIORITY 52 = impact 8 (wrong visual classification of broadcasting groups)
+ blast radius 14 (topic detail of every real instance) + reproducibility 20
(deterministic, every broadcasting row) + maintenance value 10. FIX_CONFIDENCE
95.
## Tests
- `npx vitest run src/pages/instance/__tests__/TopicPage.test.tsx -t
"BROADCASTING"`
- pre-fix (component fix stashed): `Tests 1 failed`
- post-fix: passes
- Full file: `Tests 33 passed (33)`; `npx tsc --noEmit` clean; `npx eslint
src/pages/instance/topic.tsx src/pages/instance/__tests__/TopicPage.test.tsx`
clean
## Risk
Minimal. One-line render change in a display tag; no API or data change.
Values that are not broadcast (including unknown future spellings of
clustering) keep the blue tag.
--
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]