Fix Atom dependencies during batch rebuilds - #6751
Conversation
🦋 Changeset detectedLatest commit: cb54d31 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
LifetimeProto.getreordering — aligns method-form reads with callable reads by readingparent.value()beforeaddParent(parent), preventing spurious invalidation during batch rebuilds.building/invalidatedDuringBuildflags — two new booleans onNodeImplthat track whether a node is mid-build and whether it was invalidated during its own build (detected ininvalidate()whenthis.building && batchState.phase === BatchPhase.collect).batchRebuildNodere-entry guard — nodes that reachedvalidbut were flaggedinvalidatedDuringBuildare forced stale and rebuilt instead of skipping.- Two new tests — async conditional method-form dependencies and re-entrant batch invalidation, both with clear assertions.
The three changes compose well: the reorder in LifetimeProto.get reduces spurious invalidation, the flags catch remaining cases where invalidation does occur mid-build, and the batchRebuildNode guard ensures those cases aren't missed.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Removed duplicate
atom.read()inNodeImpl.value()— the prior commit had a wasted first read that ran beforethis.building = truewith its result immediately shadowed. The fix removes that dead code and the redundanttry/finallywrapping, leaving a single read with properbuildingtracking. - No changes to tests or changeset — the two tests and changeset are unchanged from the prior commit.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏

Summary
Related upstream report: tim-smart/effect-atom#418
Testing
pnpm lint-fixpnpm --filter effect test --run test/reactivity/Atom.test.tspnpm checkCloses EFF-184