fix: Fix crash when navigating away from chart explorer search page#1278
fix: Fix crash when navigating away from chart explorer search page#1278
Conversation
🦋 Changeset detectedLatest commit: 13d0833 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code ReviewReviewed the fix for HDX-2619 (chart explorer crash). The approach is sound - maintaining a separate series field that is always an array to work around useFieldArray's limitations. Issues Found:
Validation status: The PR correctly maintains backward compatibility and handles the state transitions, but the validation layer needs attention. |
E2E Test Results✅ All tests passed • 25 passed • 3 skipped • 213s
|
7d5094c to
ea473c1
Compare
ea473c1 to
266dfc0
Compare
266dfc0 to
13d0833
Compare
brandon-pereira
left a comment
There was a problem hiding this comment.
Tested locally, worked well and issue not observed. Nice work!
Fixes HDX-2619
This PR fixes a full page crash whenever navigating away from the Chart Explorer search tab to another page. The issue was caused by the use of
useFieldArrayin theDBEditTimeChartcomponent on a field (select) which can be either an array or a string. That hook is known to crash when used on fields which are not arrays of objects.Crash example
Screen.Recording.2025-10-17.at.10.35.33.AM.mov
Fixed behavior
Screen.Recording.2025-10-17.at.10.35.08.AM.mov
The fix was to maintain a separate field (
series) which is always an array. Whenselectis an array,seriesmatchesselect. Prior to saving or submitting the chart configuration, theseriesvalue is removed and stored in theselectfield (unless theselectfield is a string, which is the case on the search tab of chart explorer).Validated:
✅ All tile types work in dashboards, without any change to the storage format (
seriesis not persisted as a separate field)✅ All chart explorer tabs work, without any change to the URL parameter format (
seriesis not persisted as a separate URL parameter field)✅ We aren't using useFieldArray anywhere else in the app
✅ AI Chart Assistant can still set the chart