I've found pretty fun bug (probably) in userService.js, there is a method setUserTimeout which sets setUserTimeoutInternal. This method sets the value for 5-6 times and these values are: '1014.1193474, 1014.1188457'.
Then in setUserTimeoutInternal method we have the next wrong piece of code:
currentUser.remainingAuthSeconds = newTimeout;
Probably you should set asNumber variable and not the newTimeout because if newTimeout comes as '1014.1193474, 1014.1188457' which is string and not the number.
This wrong string causes NaN in the next line:
currentUser.remainingAuthSeconds -= 5;
So it fails with the
if (currentUser.remainingAuthSeconds > 30)
and just logout a user which is wrong. Maybe I don't understand something but we had this bug on our project and the fix was to change to:
currentUser.remainingAuthSeconds = asNumber;
Please, contact me because I'm pretty interested in this.
CountdownUserTimeout bug found
Hi guys,
I've found pretty fun bug (probably) in userService.js, there is a method setUserTimeout which sets setUserTimeoutInternal. This method sets the value for 5-6 times and these values are: '1014.1193474, 1014.1188457'.
Then in setUserTimeoutInternal method we have the next wrong piece of code:
currentUser.remainingAuthSeconds = newTimeout;
Probably you should set asNumber variable and not the newTimeout because if newTimeout comes as '1014.1193474, 1014.1188457' which is string and not the number.
This wrong string causes NaN in the next line:
currentUser.remainingAuthSeconds -= 5;
So it fails with the if (currentUser.remainingAuthSeconds > 30)
and just logout a user which is wrong. Maybe I don't understand something but we had this bug on our project and the fix was to change to:
currentUser.remainingAuthSeconds = asNumber;
Please, contact me because I'm pretty interested in this.
Thanks!
That's interesting, not seen this being an issue before. Would you be able to submit a Pull Request for the fix?
Sure, I will do.
is working on a reply...