Guard chart components against null streaming data#487
Conversation
ankit-thesys
left a comment
There was a problem hiding this comment.
Changes look good. Can you fix the build issue? You are good to go with this PR.
|
Fixed the build issue and pushed an update to this PR. Root cause was a Prettier failure in two chart files touched by this change. Latest commit: Please recheck when you get a chance. |
|
Just read the issue. Have you tried the solution suggested there? |
|
Updated this PR to follow your suggestion. I moved the runtime guard out of the chart component library and into What changed in this update:
Latest commit: Validation on my side:
I couldn't run the full workspace typecheck/build here because this environment doesn't have the repo toolchain installed, but the PR is now aligned with the renderer/consumer approach you mentioned. Please recheck when you get a chance. |
Summary
ensureChartData()helper that normalizesnull/undefinedchart data to[]Why this fix
The chart schemas in current
mainalready require the expected fields, but that still doesn't fully protect the runtime streaming path when partial data reaches the components before the payload is complete. This PR adds the missing runtime safety layer without changing the public API.Validation
git diff --checkdataprop fromensureChartData(...)Closes #355.