You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior: There are a two core streams involved in the code above, results$ and fails$. fails$ is based off of results$ and filters out all truthy source values, meaning it only emits falsy values. results$ should now emit values until fails$ produces a value. So when results$ synchronously emits 3 values [true, true, true], fails$ should never emit and it doesn't because of the filter operator. Hence the observer passed to subscribe should be called 3 times.
Actual behavior:
The next callback should be called 3 times. However, no values are propagated via the observer passed to results$.subscribe(...). When takeUntil is removed, everything works as expected. Even if I leave takeUntil in and only change the notifier to something like interval(1000), it works as expected.
It somehow makes sense in this situation as everything is happning synchronously. This means that takeUntil creates a subscription to fails$, which then subscribes to results$. The thing is that results$ emits synchronously when takeUntil subscibres and it completes so the outer subscription on results$ will never receive any values. This is just a guess and my shot at explaining this behavior. The weird thing is that it works when using RxJS 5.5.11. Is this some edge case that was "fixed" in RxJS 6 or which one is incorrect?
We have noticed the issue while upgrading MachineLabs to RxJS 6.x. Here's the corresponding PR. Due to failing tests we were able to spot a different behavior, so we started to investigate.
The text was updated successfully, but these errors were encountered:
RxJS version: 6.2.0
Code to reproduce:
Expected behavior: There are a two core streams involved in the code above,
results$
andfails$
.fails$
is based off ofresults$
and filters out all truthy source values, meaning it only emits falsy values.results$
should now emit values untilfails$
produces a value. So whenresults$
synchronously emits 3 values[true, true, true]
,fails$
should never emit and it doesn't because of the filter operator. Hence the observer passed tosubscribe
should be called 3 times.Actual behavior:
The next callback should be called 3 times. However, no values are propagated via the observer passed to
results$.subscribe(...)
. WhentakeUntil
is removed, everything works as expected. Even if I leavetakeUntil
in and only change thenotifier
to something likeinterval(1000)
, it works as expected.Here's a StackBlitz that demonstrates the issue.
It somehow makes sense in this situation as everything is happning synchronously. This means that
takeUntil
creates a subscription tofails$
, which then subscribes toresults$
. The thing is thatresults$
emits synchronously whentakeUntil
subscibres and it completes so the outer subscription onresults$
will never receive any values. This is just a guess and my shot at explaining this behavior. The weird thing is that it works when using RxJS 5.5.11. Is this some edge case that was "fixed" in RxJS 6 or which one is incorrect?Here's a runnable demo on StackBlitz.
We have noticed the issue while upgrading MachineLabs to RxJS 6.x. Here's the corresponding PR. Due to failing tests we were able to spot a different behavior, so we started to investigate.
The text was updated successfully, but these errors were encountered: