Closed PaulD987 closed 3 years ago
So, the problem here is that when the refreshing of the token failed at 16:31:58, it went into the fail() method. This cleared the global evohome-session variable, however, it didn't stop the timer, so renewSession was called again at the session.refreshTokenInterval interval. Two things here seem appropriate. Firstly, when renewSession is called by the timer, check that there is actually a session (it could have been cleared somewhere else without the timer being stopped). And secondly, stop the timer before trying to renew the session. If the session renews successfully, a new timer will be created anyway, and if the renewal fails, then we don't want the timer at that point anyway!
Thanks for fixing this issue. I'll publish a NPM update soon.
Node-Red server failed due to unhandled exception. Maybe caused by the renewing of the token failing at 16:31... I believe I am on the latest version available. We try to debug if I have a chance.