Skip to content

fix(takeUntil): takeUntil should subscribe to the source if notifier synchronously completes without emitting#4039

Merged
benlesh merged 1 commit intoReactiveX:masterfrom
jayphelps:takeUntil
Aug 27, 2018
Merged

fix(takeUntil): takeUntil should subscribe to the source if notifier synchronously completes without emitting#4039
benlesh merged 1 commit intoReactiveX:masterfrom
jayphelps:takeUntil

Conversation

@jayphelps
Copy link
Copy Markdown
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
Copy Markdown

Coverage Status

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

Copy link
Copy Markdown
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