3 ms·
Got hit with this one a few months ago.
by miiiiiike 2y ago
Got hit with this one a few months ago.
- graypegg 2y agoJust out of curiosity, what was the use case for a really long timeout? Feels like most if not all long timeouts would be best served with some sort of "job" you could persist, rather than leaving it in the event queue.
- cout 2y agohttps://thedailywtf.com/articles/The_Harbinger_of_the_Epoch_ https://thedailywtf.com/articles/The_Harbinger_of_the_Epoch_
- graypegg 2y agoTo be fair, this will be fixed by browsers when it's within spitting distance of the scale of numbers setTimeout is normally used with. (not huge numbers) Like, if it's close enough that setTimeout(() => {}, 5000) will stop working a month later, that would be a major failure on the browser vendor's part. Much too close for comfort. But I totally understand it not being a priority if the situation is: setTimeout(() => {}, 500000000) not working in X years.
- miiiiiike 2y agoNice to have bit of client side auth code. A timer is set to update your auth status when the refresh token is scheduled to expired. I've left tabs open for 30+ days.
- BillyTheKing 2y agothis is the thing with JS and TS - the types and stuff, it's all good until you realise that all integers are basically int 52 (represented as float 64, with 52 bits for the fraction). Yes, it's nice and flexible - but also introduces some dangerous subtle bugs.
- 8n4vidtmkvmk 2y ago2^53-1 I thought. And no, they're not all that. There's a bunch that are 2^32 such as this timeout, apparently, plus all the bit shift operations.
- vhcr 2y agoNot ALL integers are 52 bit, BigInts were added on ECMAScript 2020.