Fix SubscriptionRef getAndUpdateSome None result - #6849
Conversation
🦋 Changeset detectedLatest commit: f1607ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Reproduction test for
getAndUpdateSomeNone branch bug — adds a test that callsgetAndUpdateSomewith() => Option.none()and asserts the previous value is returned as1. The test correctly reproduces the bug where theNonebranch atpackages/effect/src/SubscriptionRef.ts:377returnsEffect.succeed(current)instead ofcurrent, causing a nestedEffectto leak out.
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
- Fixed
getAndUpdateSomeNone-branch return — changedreturn Effect.succeed(current)toreturn currentatpackages/effect/src/SubscriptionRef.ts:377, matching the pattern of all other*Some*functions in the file. The reproduction test now passes. - Added changeset — patch-level release note for the bug fix.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Summary
SubscriptionRef.getAndUpdateSomeOption.noneselects no updateCovered audit issue
1.
core-s-z-testing-subscription-ref-nested-effect: getAndUpdateSome returns a nested Effect on NoneModule:
SubscriptionRefExpected contract: getAndUpdateSome returns the old A whether the update is Option.some or Option.none.
Observed result: success Exit object instead of 1
Reproduction command:
Closes EFF-293