zmuxuny opened a new pull request, #7394:
URL: https://github.com/apache/rocketmq-dashboard/pull/7394
### Which Issue(s) This PR Fixes
Fixes #6629. Replaces #6654, which was closed by the stale bot. Related
tracking: #7317.
This replacement retains the original measured-aggregate scope and adds
fresh regression coverage against
`rocketmq-studio@7abf8adaf660d75f2d686bbe8741be76c3a5ddd3`. The two production
files are byte-identical to preserved head
`50e5c7375a7d9e6903a6695954894aced3477cce`; only the two test files were
strengthened. The resulting upstream delta is four files, 256 insertions and 5
deletions.
### Brief Description
A consumer group can report a measured aggregate backlog while its
independently collected queue-progress result is empty or incomplete. The
existing health calculation returns early for empty progress and otherwise
thresholds only the queue subtotal, so it can omit a high-backlog finding even
when the reported aggregate is 10,000 messages.
Use the larger of the available aggregate and the known queue subtotal for
the existing group-lag thresholds:
- Trust a finite nonnegative aggregate unless `consumeStatsAvailable` is
explicitly false. Keep older responses without this optional field compatible.
- Keep independent queue evidence when aggregate statistics are unavailable
or invalid.
- Compare the two observations instead of adding them, and emit only one
`HIGH_GROUP_LAG` finding.
- Preserve the existing warning/critical thresholds, custom threshold
options, unknown-queue warning and unknown-total presentation. Do not invent
missing queue values or present a partial subtotal as a complete total.
The existing backend already supplies `consumeStatsAvailable`; no backend or
wire-format change is needed. #5564 concerns translation keys and explicitly
leaves thresholds and summary math unchanged. Its code is not included here;
overlapping utility/render changes will need to preserve this evidence rule
when composed.
This is not a general redesign of unknown health states. Existing
summary/runtime handling does not consistently honor explicit aggregate
unavailability, and a legacy object with no usable lag observations can still
appear healthy when its other signals are benign. Those existing limitations
are not fixed or claimed as fixed by this change. No new warning code, UI text,
translation, polling policy or timeout is introduced.
AI assistance was used for source review, regression coverage and validation.
### How Did You Test This Change?
Fresh local verification on November 4, 2026, with Node 20.20.2 and the
repository lockfile dependencies. Tests use the unchanged 20-second repository
timeout and one Vitest worker.
- Candidate utility suite: **38/38 passed**. Covers aggregate thresholds and
their boundaries, missing legacy availability flags, absent/partial queue
observations, invalid aggregate values, queue-dominant evidence, duplicate
suppression, avoiding double-counting, custom thresholds and existing
unknown-total controls.
- Four real ConsumerPage aggregate regressions: **4/4 passed**. Cover
1,000/10,000 thresholds, an older response without the availability field, and
a high aggregate beside partial queue observations. The other 72 cases were
unselected only in this focused run.
- Exact-current-base negative control: replaced only
`consumerGroupDiagnostics.ts` with the tested upstream version and kept the
candidate tests unchanged. **9 intended utility assertion failures with 29
controls passing**, and **4 intended page assertion failures**. Failure
identities were checked; no timeout or infrastructure error was accepted as
evidence of the defect.
- Restored candidate production: **38/38 utility and 4/4 page regressions
passed**.
- Complete affected suite: **164/164 passed across seven files, with no
skipped tests**. This includes **all 76 ConsumerPage tests**, 38 diagnostics
tests, 30 consumer service tests, 7 consumer-group API tests, 6 metadata API
tests, 4 consumer-lag tests and 3 connection tests. No
manual-stack/subscription isolation, assertion removal or timeout increase was
needed.
- Full frontend ESLint: passed with **0 errors and 11 existing warnings
outside the changed files**. Final changed-file ESLint and Prettier passed.
- `tsc -b --force`, standard `npm run build` and `git diff --check`: passed.
The normal Vite build and license check stayed enabled; the latter verified 134
actual components and 141 license files.
Complete affected-suite command, from `web/`:
```bash
npm test -- \
src/pages/instance/__tests__/ConsumerPage.test.tsx \
src/utils/consumerGroupDiagnostics.test.ts \
src/utils/consumerLag.test.ts \
src/utils/consumerConnections.test.ts \
src/api/consumerGroups.test.ts \
src/api/metadata.test.ts \
src/services/consumerService.test.ts \
--maxWorkers=1
npm run lint
npx --no-install tsc -b --force
npm run build
```
Validation record: the initial negative-report checker counted nested Vitest
suites as files and stopped after the expected failures. It was corrected to
inspect the actual file and assertion results; those reports were revalidated
before the successful restored/full runs. The first format check then found one
extra empty line before the new utility test block. Prettier removed only that
line; production, metadata and page tests stayed byte-identical. All 38 utility
tests and the final format, changed-file lint, TypeScript and diff checks
passed afterward.
The complete 164-test run and normal build preceded that one-empty-line
correction. An additional, redundant utility negative/restore cycle afterward
was interrupted by the execution environment before producing a negative
result. The exact candidate production was safely restored. That interrupted
cycle is not claimed as a pass; the original exact-base negative controls and
successful restoration remain the evidence, with every assertion and production
byte unchanged.
No whole-frontend-suite, backend-suite, live-broker, live-browser or new
hosted-CI pass is claimed.
### Checklist
- [x] One coherent fix, preserving the original contribution scope
- [x] Added regression cases use `Test` suffixes; existing assertions remain
intact
- [x] Exact-base negative controls and successful restoration recorded
- [x] Complete affected suite, type checks, lint, build and license check
passed as detailed above
- [x] No new UI text, source files, dependencies or workflow changes
- [x] Existing unknown-state limitations and validation boundaries documented
--
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]