Commit 945b207
committed
fix: memoize validation selector to prevent mutation and unnecessary recomputation
- Use individual selectors for blocks/edges/loops/parallels with useShallow
- Memoize validation result with useMemo, only recomputing when deps change
- Pass shallow copies of state to validateWorkflowState to prevent any
internal mutation from affecting Zustand store state
Addresses Bugbot review feedback for #35791 parent d646ee1 commit 945b207
File tree
1 file changed
+17
-8
lines changed- apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel
1 file changed
+17
-8
lines changedLines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
362 | 371 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
367 | 376 | | |
368 | 377 | | |
369 | | - | |
| 378 | + | |
370 | 379 | | |
371 | 380 | | |
372 | 381 | | |
| |||
0 commit comments