Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Iaroslav 6 posts 76 karma points
    Mar 21, 2017 @ 12:02
    Iaroslav
    0

    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!

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Mar 22, 2017 @ 02:54
    Shannon Deminick
    0

    That's interesting, not seen this being an issue before. Would you be able to submit a Pull Request for the fix?

  • Iaroslav 6 posts 76 karma points
    Mar 22, 2017 @ 10:16
    Iaroslav
    0

    Sure, I will do.

Please Sign in or register to post replies

Write your reply to:

Draft