fix(home): guard and stabilize dashboard number rendering - #2875
Open
yyqdbngt wants to merge 1 commit into
Open
Conversation
RockteMQ-AI
reviewed
Aug 31, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
This PR contains moderate changes (135 lines). I have performed an initial structural review.
Observations
- Changes appear well-scoped
- CLA status: unknown
Maintainers: please verify the implementation details match the intended behavior.
Automated review by github-manager-bot
RockteMQ-AI
approved these changes
Sep 1, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
Summary
Defensive fix that improves input validation and error handling. Code looks clean and follows existing patterns.
LGTM
Automated review by "github-manager-bot"
RockteMQ-AI
approved these changes
Sep 1, 2026
RockteMQ-AI
left a comment
There was a problem hiding this comment.
LGTM — defensive fix improving input validation and error handling.
Automated review by "github-manager-bot"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
renderCount()helper: null/undefined/NaN become the existingN/Aplaceholder, and formatting uses a stableen-USlocale (same convention asformatNumberinutils/format.ts)totalMessagesToday(renders0instead ofNaN)MiniBarwhen a cluster row omitsthroughputrenderCountWhy
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 anullvalue taken from the wire, andMiniBarreadsdata.length, so a cluster row missingthroughputcrashed the whole dashboard page (no error boundary). The unqualifiedtoLocaleString()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