Commit 4889205
authored
fix: Prevent crashes on Services and ClickHouse dashboards (#1535)
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.1 parent 103c63c commit 4889205
File tree
3 files changed
+22
-7
lines changed- .changeset
- packages/app/src
3 files changed
+22
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | | - | |
| 449 | + | |
449 | 450 | | |
450 | 451 | | |
451 | | - | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
1431 | 1432 | | |
1432 | 1433 | | |
1433 | 1434 | | |
| 1435 | + | |
| 1436 | + | |
1434 | 1437 | | |
| 1438 | + | |
| 1439 | + | |
1435 | 1440 | | |
1436 | 1441 | | |
1437 | 1442 | | |
| |||
1500 | 1505 | | |
1501 | 1506 | | |
1502 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
1503 | 1510 | | |
1504 | | - | |
| 1511 | + | |
1505 | 1512 | | |
1506 | 1513 | | |
1507 | | - | |
| 1514 | + | |
1508 | 1515 | | |
1509 | 1516 | | |
| 1517 | + | |
| 1518 | + | |
1510 | 1519 | | |
1511 | | - | |
| 1520 | + | |
1512 | 1521 | | |
1513 | 1522 | | |
1514 | | - | |
| 1523 | + | |
1515 | 1524 | | |
1516 | 1525 | | |
1517 | 1526 | | |
| |||
0 commit comments