Comment by bad_user
2 years ago
I am not getting this behaviour in Firefox 120. Tried it, logged out as well.
> setTimeout(function() { c(); a.resolve(1) }, 5E3);
The code looks like a silly concurrency bug fix, i.e., a lazy way to force ordering.
2 years ago
I am not getting this behaviour in Firefox 120. Tried it, logged out as well.
> setTimeout(function() { c(); a.resolve(1) }, 5E3);
The code looks like a silly concurrency bug fix, i.e., a lazy way to force ordering.
A 5 SECOND timeout for a concurrency issue? I doubt it.
It's timeout that's part of loading ads. That code isn't blocking anything. The headline here is wrong.
Or potentially a concurrency bug trigger? "One in 1000 times X takes a bit too long and causes problem Y; I'll make X take minimum 5 seconds so I can trigger Y reliably." Then fixes Y but forgets to remove the delay.
I can't believe billion dollar companies 'solve' bugs the same way as i do
The people working there are also just people like you.
They just practice leetcode a lot, doesn't mean they know how to deal with those issues in the UI.
Such fix won't sleep for 5000 ms though. In my reading it looks like a part of the adblocker detection code. (EDIT: Relocated the actual analysis to https://news.ycombinator.com/item?id=38346602 for more visibility.)