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(takeUntil): takeUntil should subscribe to the source if notifier synchronously completes without emitting #4039

Merged
merged 1 commit into from
Aug 27, 2018

Conversation

jayphelps
Copy link
Member

This bug was introduced in #3504, which intended to not subscribe to the source if the notifier synchronously emits a value, but instead it only skipped subscribe if it completed

https://stackblitz.com/edit/js-j72dzx?file=index.js

import { of, empty } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

// does not log anything, but it should
of(1, 2, 3).pipe(
  takeUntil(empty())
).subscribe(d => console.log(d));

Like most bugfixes this could potentially be a breaking change if someone is knowingly or unknowingly relying on this fact. Dunno what the current policy is on breaking bug fixes.

…sync completes without emitting

This bug was introduced in ReactiveX#3504, which intended to not subscribe to the source if the notifier synchronously emits a value, but instead it only skipped subscribe if it completed
@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 96.949% when pulling 44e6878 on jayphelps:takeUntil into ef3ff0b on ReactiveX:master.

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. In the docs, some notifiers - e.g. for delayWhen - are described as effecting a particular behaviour when the notifier completes, but that isn't the case for the takeUntil docs. They are explicit in stating that the notifier has to emit a value, so I think this fix should be merged.

@benlesh benlesh merged commit 21fd0b4 into ReactiveX:master Aug 27, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants