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(SafeSubscriber): Propagate disposal to terminal Subscriber #5311

Closed
wants to merge 2 commits into from

Conversation

trxcllnt
Copy link
Member

Description:
Ensure the internal SafeSubscriber is disposed when an Observable is subscribed with a Subscriber or Subscriber-like object.

Related issue (if exists):
#2675

❤️

Ensure the internal SafeSubscriber is disposed when an Observable is subscribed with a Subscriber or Subscriber-like object.

Fixes ReactiveX#2675
Copy link
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeesh. It's odd that we missed that for so long.

@cartant
Copy link
Collaborator

cartant commented Feb 22, 2020

Sorry for my tardiness in reviewing this. I'll do it tomorrow. It LGTM, but there is one situation with interop observables I want to look into.

Copy link
Collaborator

@cartant cartant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Checked and there's no relation to the interop business I mentioned in the comment I made.

@benlesh
Copy link
Member

benlesh commented Feb 26, 2020

There are some concerns here around Subject and Subjects originating from other copies of RxJS (in Node).

Copy link
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking as changes requested, just so I don't accidentally merge this until we're sure there are no bad implications with Subjects and "interop Subjects", which have unsubscribe methods on them.

@trxcllnt
Copy link
Member Author

I think foreign Subjects should be caught by these lines here, and not be wrapped in a Subscriber:

if ((nextOrObserver as any)[rxSubscriberSymbol]) {
return (nextOrObserver as any)[rxSubscriberSymbol]();
}

@cartant
Copy link
Collaborator

cartant commented Jun 9, 2020

Blocking this because of #5472

benlesh added a commit that referenced this pull request Jun 9, 2020
* test: add failing interop subscriber test

* fix: chain safe subscribers to interop subscribers

Closes #5469 #5311 #2675

* refactor: remove subscribeWith

* refactor: minor change to types to clean up code.

Co-authored-by: Ben Lesh <ben@benlesh.com>
@trxcllnt
Copy link
Member Author

I think this was superseded by #5472. Closing.

@trxcllnt trxcllnt closed this Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants