123123213weqw opened a new pull request, #5729:
URL: https://github.com/apache/rocketmq-dashboard/pull/5729
## What is the purpose of the change
The consumer group detail's online-instance table renders the protocol
column through `PROTOCOL_MAP[protocol]`, which falls back to `{ labelKey:
protocol }` when the protocol is unknown. The Apache provider builds the
instance list from a broker connection set (`ConsumerConnections.toInstances`)
that carries no protocol marker, so the API returns the field absent for every
real deployment — `t(undefined)` then resolves to `undefined` and the column
renders an empty tag on every row. The mock data always supplies
`gRPC`/`Remoting`, which is why the page looked right in mock mode. The
rmq.group.detail tool contract already models this case (its
`instances[].protocol` enum includes `UNKNOWN`); the page should degrade the
same way instead of showing an empty chip.
## Brief changelog
- Render a muted `-` placeholder when `instances[].protocol` is absent.
- Mark `protocol`, `subscribedTopics`, `lastHeartbeat` and `topicLag`
optional on the `ConsumerInstance` API type to match what the backend actually
returns; the mock-mode clone helper keeps deep-copying them when present.
## Verifying
Red-first: `ConsumerPage.test.tsx` 'renders a placeholder for an online
instance whose protocol is unknown' fails on `rocketmq-studio` (no `-` cell,
empty `.ant-tag` rendered) and passes with the change. `vitest run
src/services/consumerService.test.ts
src/pages/instance/__tests__/ConsumerPage.test.tsx` green (57 tests), `tsc -b`
clean.
--
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]