My setup when I reproduced the bug nearly every time:
- Opera Next 21.0, Web Platform flag disabled (i.e. the default, with no sticky positioning)
- Using Sidewise add-on, but I doubt it's related to this. It's just a cool Chrome add-on.
- On the homepage, middle-click a topic with at least one unread reply.
- Wait a bit, switch to that tab, bug present.
I spent my afternoon on this. It's very hard to debug something that only happens when someone posts a new message... ;) Still, it also happened from time to time on read topics.
From what I could gather, when this happens, .poster > div returns a width of 12px. Which is the horizontal padding surrounding it (don't ask me, I'm not sure why this happens.) Anyway, I 'simply' added a fallback at the start, saying basically, "if the width is less than 20px, then it's probably going to screw up, so try again in half a second". And it works. Half a second later, it always gives me the proper width.
I added a second failsafe in the form of a limitation on the number of retries. If after 10 seconds it's still buggy, then it's not worth waiting more. Just execute the-damn-thing™. (I could probably get away with 5 seconds...)
Please test new topics for you in here (if you already were able to reproduce before), and tell me if it's okay to commit!
Bed time! Okay, that was 30 minutes ago... But at least I fixed the-damn-thing™! I hope I did, at least. :P