Repository navigation
Commit c410709
fix(signals): an optimistic add/delete survives its only structural observer leaving (S7, structural half; review of #3523)
An optimistic add or delete lives on the key's PRESENCE node (target.h,
getHasNode) as its membership override. Its unobserved callback released the
node the moment the last structural observer left — with the override on it
— so `in`, Object.keys and descriptors fell back to committed structure
while the action was live: the structural twin of the value-slot bug S7
fixed. The presence node now defers its release through deferSlotRelease
while it carries an override or a staged value; the transient-node sweep
runs its callback once the state resolves.
Pinned for optimistic add and delete: the only structural observer gates
away, in / Object.keys / getOwnPropertyDescriptor keep the optimistic
structure while the action is live, settlement restores committed structure
and releases target.h[key].
Suite green; oracles and matrix identical; +35 B minified store.
Co-authored-by: Claude via Cursor <[email protected]>1 parent 9db33cf commit c410709
3 files changed
Lines changed: 59 additions & 0 deletions
File tree
- .changeset
- packages/signals
- src/store/next
- tests
| 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 | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
480 | 487 | | |
481 | 488 | | |
482 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
482 | 529 | | |
483 | 530 | | |
484 | 531 | | |
| |||
0 commit comments