fix: Prevent crashes on Services and ClickHouse dashboards#1535
fix: Prevent crashes on Services and ClickHouse dashboards#1535kodiakhq[bot] merged 2 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 03bc47e 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.
|
PR Review✅ No critical issues found. The fix properly addresses infinite render loops by using Minor observations:
Pattern is sound for breaking the render loop. Good job including comments explaining why |
E2E Test Results✅ All tests passed • 51 passed • 5 skipped • 702s
Tests ran across 4 shards in parallel. |
Closes HDX-3125
Closes HDX-3126
Summary
This PR fixes two application crashes due to infinite render loops:
useQueryState value updates --> set form values --> trigger form's useWatch/watch --> triggers useEffect --> calls setQueryState --> repeat....In these cases, the fix is to compare useWatch values to the previous useWatch value (using usePrevious) and only call setQueryState when the form value has changed. Before, the useEffect was also called when the query state changes.