moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
315 stars 128 forks source link

keepalive onPingResponse subscribe response doesnt work right #118

Closed hakim-dc closed 5 years ago

hakim-dc commented 5 years ago

I'm submitting a ...


[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
* **@ng-idle version:** 6.0.0-beta.3

* **Angular version:** 6.x

* **Browser:** all

* **Language:** TypeScript 2.7.2
* **Node:** `node --version` = v10.9.0
mmubasher commented 5 years ago

@HackedByChinese Kindly review and merge pull request #120

mmubasher commented 5 years ago

Can you please release this on npm as we need this change available? I tried npm run bundle and it created the packages but deployments will only work with the npm packages @ng-idle/core and @ng-idle/keepalive. It would be great if you can release a package soon. Thank you

moribvndvs commented 5 years ago

it's published as 6.0.0-beta.4