-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: chain subscriptions from interop observables #5059
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me... However, I'd love it if we could add comments to explain why things are structured the way the are in the changed areas. Also, a brief comment in the test about what an "interop" is, just explain the scenario. :)
Thanks, @cartant!
Added comments. |
@cartant: Unfortunately, the patch branch will need a separate PR. Can you tackle that? The problem is that the tests have changed between the two branches. |
Description:
This PR fixes a bug in which subscriptions returned from interop observables are ignored - instead of being composed into the subscription chain. Prior to this fix, when an interop observable was returned to a flattening operator - like
mergeMap
orswitchMap
- the interop observable would not be unsubscribed upon explicit unsubscription from the flattening operator.The bug was introduced in the changes made in #2479 and #4037.
This PR:
subscribeToResult
was passed outer values and indices when they should have been passed to theInnerSubscriber
(the bug would have manifested itself in the now-deprecated result selectors for the flattening operators); andsubscribeToResult
signature to make it safer (if anInnerSubscriber
is passed,value
andindex
must beundefined
and must be passed via theInnerSubscriber
instead).Related issue (if exists): #5051