This has to do with observables being cancelled, although I must admit I don’t know the root cause for the problem you face.
I ran into a similar problem using the ngrx/effects module. The action handler made requests to a service using ngrx switch map operator. All except the last request would get cancelled. Changing it to merge map fixed the problem.
Below is the code
@Effect()
loadSomeData$: Observable<Action> = this.actions$
.ofType(SomeActions.Load_Data)
.mergeMap((id) =>
this.someService.getSomething(id)
.map((someEntity) => new SomeActions.LoadDataSuccess(someEntity)
).catch((x, y) => {
console.error('Error occured');
return Observable.of(new SomeActions.LoadDataFailed(id));
}
));
Reproducing the relevant part of ngrx here.
https://www.learnrxjs.io/operators/transformation/switchmap.html
The main difference between switchMap and other flattening operators is the cancelling effect. On each emission the previous inner observable (the result of the function you supplied) is cancelled and the new observable is subscribed. You can remember this by the phrase switch to a new observable.