This topic was marked solved by Nao, on May 29th, 2014, 08:33 PM
« [switch languages] Weird error
follow_me() bug, shows up from time to time.

MultiformeIngegno

  • Posts: 1,337

Nao

  • Dadman with a boy
  • Posts: 16,079
Re : follow_me() bug, shows up from time to time.
« Reply #1, on January 28th, 2014, 01:25 PM »
Does it happen when you come back to a tab, or when you first load it?

In the past, I found that very rarely, when coming back to a tab (in Chrome), my div size math was returning a zero and I was stuck with zero-width divs in the user box. Sometimes I would also get much larger sizes than expected. I fixed that by being more careful about tab switching, but maybe Firefox doesn't play along.

Is the text out of bounds only when it's in follow_me mode, or even outside of it? (e.g. you're viewing the post before it.)

MultiformeIngegno

  • Posts: 1,337

Nao

  • Dadman with a boy
  • Posts: 16,079
Re : follow_me() bug, shows up from time to time.
« Reply #4, on January 29th, 2014, 03:58 PM »
Okay, I can (finally!) reproduce this all the time... Under Opera 20 Developer, with web platform disabled.
Take a topic that only has me in it (hello!), such as Plugin Revs or New Revs.
From the homepage, open it in a new tab by middle-clicking it.
*Wait for it to load*. This is important!
Then switch to it. Problem reproduced.
If you switch to the new tab as soon as you launch it, then the script will apply proper dimensions to the user box. If you don't, then it will screw up.
Which is really, really odd because topic.js has pagevisibility events that are specifically there to avoid this problem... :-/

Can anyone confirm, maybe..? With Chrome, or Firefox, or anything?

Pandos

  • Living on the edge of Wedge
  • Posts: 635
# dpkg-reconfigure brain
error: brain is not installed or configured

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: follow_me() bug, shows up from time to time.
« Reply #6, on January 29th, 2014, 06:54 PM »
Hmm, okay then...
Perhaps it's due to my latest 'fix', I don't know. I only inverted two things, and I don't even think it had an influence.

Farjo

  • "a valuable asset to the community"
  • Posts: 492

Pandos

  • Living on the edge of Wedge
  • Posts: 635

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: follow_me() bug, shows up from time to time.
« Reply #11, on April 10th, 2014, 02:55 PM »
I still rarely get the bug where I get a 10000px+ height on every post when loading the tab in the background. So it's not fully fixed.
I dunno if I should wait for Google to enable position sticky outside of the web platform flag. Not sure why they've been waiting so long for that... Something like 2 years! Even Firefox has yet to unprefix it... Why? Works so well for me...

Farjo

  • "a valuable asset to the community"
  • Posts: 492
Re: follow_me() bug, shows up from time to time.
« Reply #12, on April 10th, 2014, 03:19 PM »
"unprefix" is a nice word :)

So if it's rare then if Google enable it then it can be changed, and if they don't then, well, it is a rare problem. If I saw it I'd probably think 'bloody internet' and hit F5, which presumably fixes it.

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: follow_me() bug, shows up from time to time.
« Reply #13, on April 16th, 2014, 12:32 AM »
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

Sara

  • Walking Contradiction
  • Posts: 41

« [switch languages] Weird error