-
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
nested concatMaps no longer next values to destination in 6.3.0 #4071
Comments
cc @hansl @IgorMinar |
This seems to specifically have to do with promises, FYI: const results: any[] = [];
of(1).pipe(
concatMap(() =>
from(Promise.resolve(2)).pipe(
concatMap(() => Promise.resolve(3))
)
)
)
.subscribe({
next(value) { results.push(value); },
complete() { results.push('done'); }
});
setTimeout(() => {
expect(results).to.deep.equal([3, 'done']);
done();
}, 0); |
Specifically, it seems to be due to the outermost promise. If you comment out the of(1).pipe(
concatMap(() =>
from(Promise.resolve(2))
// of(2, asapScheduler)
.pipe(
concatMap(() => defer(() => {
console.log('sub');
return of(3, asapScheduler).pipe(
tap(() => console.log('next')),
finalize(() => console.log('unsub'))
);
}))
)
)
)
.subscribe({
next(value: any) { results.push(value); },
complete() { results.push('done'); }
}); When the promise is used, it appears to subscribe to the innermost observable and then immediately unsubscribe. And then it seemingly doesn't complete, as there's no I can look further into this later, if you've not already resolved the regression in the interim. |
This fails, too, and does not use a promise: of(1).pipe(
concatMap(() =>
defer(() => {
console.log('outer-sub');
return of(2, asapScheduler).pipe(
tap(() => console.log('outer-next')),
finalize(() => console.log('outer-unsub'))
);
})
.pipe(
concatMap(() => defer(() => {
console.log('inner-sub');
return of(3, asapScheduler).pipe(
tap(() => console.log('inner-next')),
finalize(() => console.log('inner-unsub'))
);
}))
)
)
)
.subscribe({
next(value: any) { results.push(value); },
complete() { results.push('done'); }
});
setTimeout(() => {
console.log(results);
}, 0); It emits a value, but does not complete. Works under 6.2.2. |
Don't add self as parent. Closes ReactiveX#4071
Bug Report
Current Behavior
Currently if you nest a
concatMap
inside of aconcatMap
, and the source completes, the inner most concatMap will not forward along values.Reproduction
Expected behavior
It should work like it did in 6.2
Environment
Possible Solution
None
The text was updated successfully, but these errors were encountered: