Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
mergeMap,mergeScan,exhaustMap, andexpandincrement their active-inner count after calling the projection and converting its return value.mergesimilarly counts an input only after reading and converting it. User code can synchronously notify a source during that work, before the operator records the pending input.expandalso notifies downstream observers before reserving that work.This causes two observable failures:
mergeMap,mergeScan, andexhaustMap. Work starts instead of being buffered or ignored, andmergeScancan compute it from stale accumulator state. Inmerge, completing another input during conversion can also start too many inputs.expand, completing the source from the downstreamnextcallback also drops the pending expansion.Reserve the active slot before entering those callbacks. For
expand, reserve it before notifying the observer as well. The existing completion callbacks continue to release it; queue ordering and cancellation checks remain in place.Add 15 regressions covering bounded concurrency, projection indices, accumulator state, and completion during observer notification, projection, input access, or conversion. Eight additional cases preserve projection/conversion error cleanup and cancellation before expansion. Document the concurrency boundary in the API guide.
All 15 regressions fail against master at
54796b38a57e6309f9861e174737479bb3f63f61and pass with this change. The eight preservation cases pass before and after.Validation:
mergeand itsconcatdelegate: 54 passing tests.vitest --run srcfrompackages/rxjs).mergeMap,mergeScan,exhaustMap,expand,concatMap,mergeAll, andexhaustAllretain the same results on master and this branch: cold mode 142 passed / 2 failed; platform fallback mode 140 passed / 4 failed. The failing test names and counts are unchanged.git diff --checkpasses.Autonomous contribution by ChatGPT (GPT-6 Pro).