fix(agera): sync with alien-signals v3.2.1#160
Conversation
Port of alien-signals commit fb17aed.
Port of alien-signals commit c28a596 (issue #105).
Regression coverage for the alien-signals issue #99 scenario, which is already handled in agera by the flushDepth mechanism. Upstream commits 7e53655 and d4d0449 (runDepth-based fix) are intentionally not ported: the bug does not reproduce here and the port showed no observable effect.
… disposes it Port of alien-signals commits cf75b33 and 4b15362 semantics (#113).
…after reading it Port of alien-signals commits 9daa5c3 and c00e639 (issue #122).
New sync point is c00e639: flattened upstream diff snapshot plus a sync report with ported commits, deliberate skips and accepted divergences.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
==========================================
- Coverage 83.81% 83.79% -0.03%
==========================================
Files 137 137
Lines 2966 2962 -4
Branches 555 558 +3
==========================================
- Hits 2486 2482 -4
Misses 340 340
Partials 140 140 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates agera’s internal reactive runtime to match upstream alien-signals v3.2.1 behavior (plus two additional commits), primarily addressing several edge-case crashes/resurrection scenarios involving trigger, checkDirty, effectScope, and effect destroy/stop semantics.
Changes:
- Ports upstream runtime fixes into
packages/agera/src/internals/system.ts(trigger flush crash prevention, resilient dirty-checking under graph mutation, effect destroy recursion/resurrection handling, and effectScope participation in propagation). - Adds a substantial set of regression tests covering the newly-ported behaviors and prior crash cases.
- Updates size-limit thresholds for
agera,kida, andstorebased on the new bundle output, plus adds a new sync snapshot + report underpackages/agera/history/.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/agera/src/internals/system.ts | Ports alien-signals v3.2.1 runtime semantics and multiple bug fixes into agera’s core reactive system. |
| packages/agera/src/effect.spec.ts | Adds regression tests for effect cleanup/disposal edge cases, checkDirty mutation resilience, and effectScope propagation behavior. |
| packages/agera/src/signal.spec.ts | Adds regression tests for writing a signal inside trigger after reading it. |
| packages/agera/history/v3.2.1-c00e639.md | Adds a sync report documenting what was ported vs deliberately skipped and why. |
| packages/agera/history/v3.2.1-c00e639.diff | Adds a flattened upstream-vs-agera snapshot diff for auditability of the sync point. |
| packages/agera/.size-limit.json | Updates agera bundle size limits to reflect reduced output size after the port. |
| packages/kida/.size-limit.json | Updates kida bundle size limits to reflect reduced output size after the port. |
| packages/store/.size-limit.json | Updates store bundle size limits to reflect reduced output size after the port. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ports upstream alien-signals changes since the last sync point (
836130c, v3.1.2) up toc00e639(v3.2.1 + 2 commits). Each upstream change was analyzed, reproduced where applicable, and either ported or deliberately skipped. Full report:packages/agera/history/v3.2.1-c00e639.md.Ported
fb17aedad52894+b83cf94+fbabdbdcheckDirtyupdate (alien-signals#109, alien-signals#115) — reproduced in agera before the portc28a596effectScope(alien-signals#105) — reproducedcf75b33+4b15362stop()+ effect resurrection when destroy disposes it (alien-signals#113) — reproduced9daa5c3+c00e639triggerafter reading it (alien-signals#122) — reproducedSkipped deliberately
7e53655+d4d0449(runDepth/innerWrite, alien-signals#112) — the alien-signals#99 bug class is already covered by agera'sflushDepthmechanism, which additionally fixes lost notifications that upstream still has at HEAD. Porting was prototyped: zero observable effect. Regression tests added instead.713a1c6(LIFO disposal, alien-signals#116) — redefines cleanup ordering; agera keeps its own contract (own destroy first, children FIFO). Accepted divergences documented in the history report.History
packages/agera/history/v3.2.1-c00e639.diff(flattened upstream vssrc/internals) and sync reportv3.2.1-c00e639.md.Tests