unbridled-41 commented on PR #5920:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/5920#issuecomment-6091060070

   ### Follow-up review of this fix: two more places still read the placeholder 
as a measurement
   
   The table column and the detail dialog now say the delay is unknown, but two 
other consumers of the same field still presented the provider's placeholder 
zero as a measurement:
   
   1. `web/src/utils/consumerGroupDiagnostics.ts` — the health analysis coerced 
`delaySeconds` to `0` and compared it against the delay thresholds, so a group 
whose delay could not be measured produced no `HIGH_CONSUME_DELAY` issue and 
was reported as healthy/caught up. It now emits an explicit 
`CONSUME_DELAY_UNKNOWN` warning (same shape as the existing `UNKNOWN_QUEUE_LAG` 
issue) and adds the matching recommendation, while a measured delay is judged 
exactly as before.
   2. `web/src/services/consumerService.ts` — the group CSV export wrote the 
placeholder as `Delay Seconds = 0`, i.e. "caught up" in a file an operator 
keeps. It now writes `unknown`, the same convention the neighbouring `Online 
Instances` column already uses for its unavailable sentinel.
   
   Commit `bd779971` contains both (first commit `67ec90b7` untouched, no 
force-push). The check is deliberately `consumptionTimestampAvailable === 
false`, so a payload that omits the optional field keeps its previous behaviour.
   
   Tests added: `reports an unmeasurable consume delay as unknown instead of a 
healthy zero` and `keeps judging a measured delay` 
(`consumerGroupDiagnostics.test.ts`), and `renders an unmeasurable consume 
delay as unknown instead of the placeholder zero` (`consumerService.test.ts`, 
which also pins that a *measured* zero stays numeric).
   
   Red/green, both observed locally:
   
   ```
   # with the diagnostics and CSV changes reverted
   cd web && npx vitest run src/utils/consumerGroupDiagnostics.test.ts 
src/services/consumerService.test.ts
    Tests  2 failed | 26 passed (28)
   
   # with bd779971
   cd web && npx vitest run src/utils/consumerGroupDiagnostics.test.ts 
src/services/consumerService.test.ts 
src/pages/instance/__tests__/ConsumerPage.test.tsx
    Test Files  3 passed (3)
         Tests  76 passed (76)
   ```
   
   `npx tsc -b` and `npx eslint` on the four touched files are clean.
   
   Branch `fix/consumer-delay-unavailable`, HEAD `bd779971` (on top of 
`67ec90b7`).


-- 
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]

Reply via email to