-
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
forkJoin doesn't wait for last input's finally block #4914
Comments
This does not look like a bug, to me. The first thing to note is that the code logs |
So is this the order of execution:
|
const source = forkJoin(
[1, 2, 3, 4].map(n =>
timer(100).pipe(
map(() => n),
finalize(() => console.log(`Finalized ${n}`))
)
)
);
source.subscribe(console.log); Output:
It's certainly surprising behavior, I guess. I mean, I know why it's happening, but I think it would be best if it were more predictable. IMO, this is a bug similar to some other issues I've fixed recently. And I can think of other places this is probably happening too. |
FWIW, this predictability - i.e. a simple/small set of rules - is one of the things I had in mind when we were discussing the |
RxJS version: 6.5.2
Additional information:
forkJoin doesn't seem to wait for the last input's finally block when the input observables have finally blocks.
Code to reproduce:
https://stackblitz.com/edit/angular-u3vqnu
Expected behavior:
Actual behavior:
The last "completed" one isn't always necesserily the 10th one, any other could be.
The text was updated successfully, but these errors were encountered: