-
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
Many operators do not call teardown logic of source Observable immediately after it completes or errors #2459
Labels
bug
Confirmed bug
Comments
Okay, in order to resolve this, we need to figure out every path that has this issue, file separate bugs for those, then close this issue. |
cartant
added a commit
to cartant/rxjs
that referenced
this issue
Jul 27, 2018
Merged
cartant
added a commit
to cartant/rxjs
that referenced
this issue
Jul 28, 2018
Closing this as a related PR has been merged. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
#2457 - general problem description and proposed solution.
#2455 - bug that made me discover an issue, directly caused by it. Contains much more in-depth explanation of what is happening in that concrete case.
Consequences:
switchMap
).create
) will not have their teardown logic called when they complete, when combined with operator that prolongs subscription (hereswitchMap
):onErrorResumeNext
) might still hold subscription to an Observable that had an error in its operator chain:What operators it affects?
Points 1. and 2. affect all operators that have following pattern in their unit tests:
since
|
is the moment when Observable completes and!
is the moment when unsubscription function is called (which happens too late or sometimes does not happen at all).Point 3. from what I have seen affects only
onErrorResumeNext
but in general it might affect all operators with following pattern in their unit tests:since
#
marks the moment when Observable errored and!
marks the moment when unsubscription function is called.Alternative fix:
take
does: https://github.com/ReactiveX/rxjs/blob/master/src/operator/take.ts#L80). PRs: fix(first): force unsubscription logic on complete and error #2463 fix(takeWhile): force unsubscribe when it completes or errors #2470 fix(elementAt): force unsubscribe when it completes or errors #2501 fix(find): force unsubscribe when it completes or errors #2550???
???
The text was updated successfully, but these errors were encountered: