Frun1na opened a new pull request, #6112:
URL: https://github.com/apache/rocketmq-dashboard/pull/6112
### Which Issue(s) This PR Fixes
- Fixes #6110
### Brief Description
`ProducerConnectionSummaryVO.from` counted its distribution buckets —
including the `UNKNOWN` bucket that
`normalizeDimension` creates for a connection that reported nothing — as
distinct languages and versions. One
client reporting `5.1.0` next to one reporting nothing therefore produced
`uniqueVersionCount = 2`, which the
Producer page renders as `Versions: 2` and turns into `MIXED_CLIENT_VERSION`
("clients are running different
versions") — a mix the data does not show, and one the same collection
already describes accurately as
`INCOMPLETE_CLIENT_METADATA`.
Only buckets a client really reported are counted now
(`reportedDimensionCount`, next to the existing
`distribution`/`normalizeDimension` helpers). The `UNKNOWN` bucket stays in
the distribution the page renders,
`none`-/blank-reporting connections keep raising
`INCOMPLETE_CLIENT_METADATA`, and two genuinely different
versions still raise `MIXED_CLIENT_VERSION`.
User-visible change: the Producer page reports the number of
versions/languages that were actually observed and
no longer warns about a version mix when a client simply did not report its
version.
### How Did You Test This Change?
```
cd server && mvn -B -ntp test -DforkCount=1
-Dsurefire.failIfNoSpecifiedTests=false -Dtest=ProducerConnectionSummaryVOTest
[INFO] --- checkstyle:3.6.0:check (validate) @ rocketmq-studio ---
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
```
The new case fails without the fix, with only the product file reverted:
```
[ERROR] Tests run: 6, Failures: 1, Errors: 0, Skipped: 0
fromShouldNotCountAnUnreportedVersionAsASecondVersionTest -- <<< FAILURE!
org.opentest4j.AssertionFailedError:
expected: 1
but was: 2
at
...ProducerConnectionSummaryVOTest.fromShouldNotCountAnUnreportedVersionAsASecondVersionTest(ProducerConnectionSummaryVOTest.java:97)
```
The existing cases pin the rest of the contract: two reported versions still
add `MIXED_CLIENT_VERSION`, an
incomplete scan still adds `INCOMPLETE_SCAN`, and incomplete metadata still
adds
`INCOMPLETE_CLIENT_METADATA`.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` /
`refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named
`...Test`
- [ ] New UI text has both Chinese and English entries under `web/src/i18n/`
- [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit
checks)
- [ ] New source files carry the ASF license header
- [ ] Documentation touched where behaviour changed (README / `docs/` /
in-app help)
--
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]