Add reproduction for TxQueue issue - #6853
Conversation
🦋 Changeset detectedLatest commit: a8fad6e 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
offerAll preserves a one-shot iterable across retries— adds a reproduction test that demonstratesTxQueue.offerAllloses items from one-shot generators when the bounded queue is full and the STM retries, re-exhausting the iterable.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
| Effect.gen(function*() { | ||
| const rejected: Array<A> = [] | ||
| Effect.suspend(() => { | ||
| const valuesArray = Array.from(values) |
There was a problem hiding this comment.
This should be materialized outside of the effect so it is re-usable between seperate runs.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Iterable materialization in
TxQueue.offerAll— wrappedArray.from(values)inEffect.suspendso one-shot iterables are consumed once before enteringEffect.tx, preventing STM retries from re-exhausting the generator. - Test synchronization — replaced the
iterationscounter plus busy-waityieldNowloop with aLatch, giving deterministic coordination between the forkedofferAlland the parent test.
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
Effect.suspend, materialized iterable at function scope —Array.from(values)now runs atofferAllcall time (line 612), before any effect tree, so the captured array survives both STM retries and repeated effect runs. - Test now covers effect reuse — the test runs the returned
offereffect a second time and verifies the same captured item is produced, plus replacedLatchsynchronization with{ startImmediately: true }for deterministic execution.
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
TxQueue.offerAllto materialize input iterables outside the effectTesting
Closes EFF-295