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(repeat): Ensure teardown happens between repeated synchronous obs… #5620

Merged

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Aug 3, 2020

…ervables

  • Simplifies repeat code
  • Removes reliance on unsubscribeAndRecycle
  • Gets rid of strange, undocumented behavior where numbers less than zero were treated like positive infinity
  • Fixes an issue where finalize would be called N times after the completion of the resulting observable if the source was synchronous.
  • Fixes an issue where N unsubscriptions would always occur after the total completion.

BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to repeat would result in an observable that repeats forever.

benlesh added 3 commits August 3, 2020 00:49
…ervables

- Simplifies repeat code
- Removes reliance on unsubscribeAndRecycle
- Gets rid of strange, undocumented behavior where numbers less than zero were treated like positive infinity
- Fixes an issue where `finalize` would be called N times after the completion of the resulting observable if the source was synchronous.
- Fixes an issue where N unsubscriptions would always occur after the total completion.

BREAKING CHANGE: An undocumented behavior where passing a negative count argument to `repeat` would result in an observable that repeats forever.
@benlesh benlesh requested a review from cartant August 3, 2020 06:03
@benlesh
Copy link
Member Author

benlesh commented Aug 3, 2020

I seriously considered removing lift with this one... but we can wait for v8.

I suspect that retry has the same issue... but I have not checked yet.

benlesh added a commit to benlesh/rxjs that referenced this pull request Aug 3, 2020
…onous observables

Related: ReactiveX#5620

- Resolves an issue where all teardowns would not execute until the result observable was complete if the source was synchronous

BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to `retry` would result in an observable that repeats forever.
if (++soFar < count) {
if (innerSub) {
subscription.remove(innerSub);
innerSub.unsubscribe();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason innerSub is not nulled here?

I think that if it isn't, there will be a problem if the source is async on the first subscription and sync on a subsequent subscription - as innerSub won't be null for the subsequent completion, despite that completion being synchronous.

Copy link
Member Author

Choose a reason for hiding this comment

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

nope... just didn't think of it. Also, that remove is superfluous, teh unsubscribe will do that...

@benlesh benlesh merged commit 0ca8a65 into ReactiveX:master Aug 5, 2020
benlesh added a commit to benlesh/rxjs that referenced this pull request Aug 5, 2020
…onous observables

Related: ReactiveX#5620

- Resolves an issue where all teardowns would not execute until the result observable was complete if the source was synchronous

BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to `retry` would result in an observable that repeats forever.
benlesh added a commit that referenced this pull request Aug 6, 2020
…onous observables

Related: #5620

- Resolves an issue where all teardowns would not execute until the result observable was complete if the source was synchronous

BREAKING CHANGE: Removed an undocumented behavior where passing a negative count argument to `retry` would result in an observable that repeats forever.
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