Repository navigation
Commit f743029
committed
fix(compiler): follow state-tuple and effect-event helpers in deferred snapshot mutation check
The outside-render helper walk only followed a call when an argument had
kind === 'snapshot'. A whole useState/useReducer tuple (kind === 'state-tuple')
was skipped, so passing the tuple into a local helper from an event or timer
never re-bound the parameter and mutations through pair[0] escaped the
OCTANE_STRONG_SNAPSHOT_MUTATION diagnostic.
Similarly, useEffectEvent results (kind === 'effect-event') were not considered
by the deferred-phase callback kind check. An event-time call that passes a
state value into an Effect Event never re-entered the body with those arguments.
Fix: unwrap effect-event to its inner callback before the kind check, and
include state-tuple alongside snapshot in the argument filter. Add regression
tests for both patterns.1 parent 3f7b937 commit f743029
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4477 | 4477 | | |
4478 | 4478 | | |
4479 | 4479 | | |
4480 | | - | |
| 4480 | + | |
| 4481 | + | |
4481 | 4482 | | |
4482 | 4483 | | |
4483 | | - | |
| 4484 | + | |
| 4485 | + | |
| 4486 | + | |
4484 | 4487 | | |
4485 | 4488 | | |
4486 | 4489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
165 | 173 | | |
166 | 174 | | |
167 | 175 | | |
| |||
0 commit comments