Skip to content
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 for interop with finalize #5239

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

cartant
Copy link
Collaborator

@cartant cartant commented Jan 17, 2020

Description:

The change in this PR is very similar to the changes that were made in #5059: when an interop subscriber is created within finalize, it'll be wrapped when a subscription is made to the source observable in FinallyOperator#call. The interop subscriber needs to be added to the subscription so that unsubscription chains property and the finalize callback is invoked.

The adding of the interop subscription is now handled in subscribeWith - which was added in #5333.

This PR also includes a failing test that is fixed by the above change.

Related issue (if exists): #5237

src/internal/operators/finalize.ts Outdated Show resolved Hide resolved
@cartant
Copy link
Collaborator Author

cartant commented Jan 27, 2020

Is this something we should just be doing in Observable subscribe?

@benlesh I had a quick look at this and the issue with putting this functionality into subscribe is that there are some subscribers upon which unsubscribe should not be chained: subjects. Calling unsubscribe on a subject closes/stops it. And if the change in this PR is added to subscribe, a bunch of multicast and multicast-related tests fail.

@cartant cartant changed the title fix: chain subscriptions for interop with finalize [WIP] fix: chain subscriptions for interop with finalize Mar 1, 2020
@cartant cartant added the PR: WIP label Mar 1, 2020
@cartant
Copy link
Collaborator Author

cartant commented Apr 22, 2020

Closed by #5333

@cartant cartant closed this Apr 22, 2020
@cartant
Copy link
Collaborator Author

cartant commented Apr 22, 2020

Nope, #5333 doesn't close this. Rather, this PR needs to be refactored to use subscribeWith.

@cartant cartant reopened this Apr 22, 2020
@cartant cartant removed the PR: WIP label Apr 23, 2020
@cartant cartant requested a review from benlesh April 23, 2020 01:37
@cartant cartant changed the title [WIP] fix: chain subscriptions for interop with finalize fix: chain subscriptions for interop with finalize Apr 23, 2020
@benlesh benlesh merged commit 04ba662 into ReactiveX:master Apr 29, 2020
@cartant cartant deleted the issue-5237 branch September 24, 2020 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants