grbsk / ng-idle

Responding to idle users in AngularJS applications.
http://hackedbychinese.github.io/ng-idle
MIT License
564 stars 195 forks source link

keepalive onPingResponse subscribe response doesnt work right #221

Open hakim-dc opened 6 years ago

hakim-dc commented 6 years ago

[X] bug report

Current behavior this subscription must return the web-service response used to update session expiry time "keepalive.onPingResponse.subscribe(response => console.log(response);"

Expected behavior after subscribe onPingResponce the response.status must return the status of invoked http request in "response.status" example: 200 for success

Minimal reproduction of the problem with instructions the main problem is that this subscription always return first a response that contain a type equal to 0 after that it return the real webservice response (response.status not null ) for each keepalive webservice pingRequest but in the other hand when the webservise return request.status different to 200 (not success) we get first also a response that contain a type equal to 0 and no other response.

What is the motivation / use case for changing the behavior? my expected behavior is that method return only response that contain the http request status in case of success or fail of web-service invocation and remove the responce that contain type equal to 0 "response.type = 0"

Please tell us about your environment: Ubuntu, visualCode, npm