I do have an Angular 5 Application which uses HttpClient to make a backend service call.
If the Service takes some time to return, Angular triggers a second call (Exactly after 120 seconds) which should not happen.
I have verified and there is no retry logic present in the code nor other functioanlity calling the same service again.
Can someone help me understand if this is a bug in Angular 5 or some sort of default beahvior.
public appPost(inputObj: InputObj) {
return this.httpClient
.post('_url_', inputObj)
.timeoutWith(300000, Observable.throw({"error" : "The Application has timed out. Please Contact Administrator."}));
}
this.appService.appPost(inputObj).subscribe(
(resp: any) => {
//do something
},
error => {
//throw error
}
);
Also, I did some debugging and found that the second call is not shown in the network section of chrome debugging tools. But if you add an interceptor and log the calls it gets dispalyed there.