You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yyqdbngt (via GitHub)" <gi...@apache.org> on 2026/08/31 23:04:18 UTC

[PR] fix(home): guard and stabilize dashboard number rendering [rocketmq-dashboard]

yyqdbngt opened a new pull request, #2875:
URL: https://github.com/apache/rocketmq-dashboard/pull/2875

   ## Summary
   - Consolidate dashboard number rendering into an exported `renderCount()` helper: null/undefined/NaN become the existing `N/A` placeholder, and formatting uses a stable `en-US` locale (same convention as `formatNumber` in `utils/format.ts`)
   - Apply it to the broker/proxy/TPS-in/TPS-out table columns and the TPS-out stat card detail
   - Guard the "million messages" stat detail against a non-finite `totalMessagesToday` (renders `0` instead of `NaN`)
   - Pass a guaranteed array to `MiniBar` when a cluster row omits `throughput`
   - Add regression tests: a cluster with null TPS values and a missing throughput series renders without crashing, plus unit tests for `renderCount`
   
   ## Why
   Dashboard data comes from the backend over JSON, so field shapes are not guaranteed even when the TypeScript type says otherwise. Two crash/leak paths: `v.toLocaleString()` on the TPS columns throws for a `null` value taken from the wire, and `MiniBar` reads `data.length`, so a cluster row missing `throughput` crashed the whole dashboard page (no error boundary). The unqualified `toLocaleString()` calls additionally produced locale-dependent separators that varied with the viewer's browser locale, inconsistent with the rest of the app's stable formatting.
   
   ## Testing
   - `./node_modules/.bin/vitest run src/pages/home/` → 12 passed (2 new)
   - `./node_modules/.bin/tsc --noEmit` → clean
   - `./node_modules/.bin/eslint src/pages/home/dashboard.tsx src/pages/home/__tests__/DashboardPage.test.tsx` → 0 errors
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(home): guard and stabilize dashboard number rendering [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #2875: fix(home): guard and stabilize dashboard number rendering
URL: https://github.com/apache/rocketmq-dashboard/pull/2875


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(home): guard and stabilize dashboard number rendering [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2875:
URL: https://github.com/apache/rocketmq-dashboard/pull/2875#issuecomment-5593764180

   This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org