Add reproduction for TxPubSub issue - #6850
Conversation
🦋 Changeset detectedLatest commit: 8c32aef 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 — a single reproduction test added to TxPubSub.test.ts:
publishAll preserves a one-shot iterable across retries— exercises the exact failure mode described in the audit: whenpublishAllruns inside an STM transaction against a bounded hub whose subscriber queue is full, the transaction retries re-iterates the input iterable; a one-shot generator is already exhausted on retry, so the value (2) is silently dropped.
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 since the last review (41e300e):
- Implemented the fix —
publishAllnow materializes the input iterable to an array viaArr.fromIterable(values)before entering the STM transaction, so one-shot iterables (generators, streams) are not exhausted on retry. - Updated the reproduction test — added a
hasIteratedhelper for the idle-await loop and theOptionimport for the assertion; the test now passes. - Added changeset —
fix-txpubsub-publish-all-iterables.mdscoped as apatchforeffect.
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.
|

Reproduction only
This PR adds reproduction tests only. No implementation fix is included. CI is expected to fail until the underlying issue is fixed.
Covered audit issues
1.
core-s-z-testing-tx-pub-sub-publish-all-iterable: publishAll consumes restart-sensitive iterables transactionallyModule:
TxPubSubExpected contract: publishAll accepts any Iterable, and bounded hubs retry until subscriber capacity becomes available without dropping accepted messages.
Observed result: Option.none instead of Option.some(2)
Reproduction command: