XF 1.4 Not scrolling to unread post

Floyd R Turbo

Well-known member
Not sure if this is a bug or what so just putting it in the Troubleshooting area.

I've noticed that when I get an e-mail alert for a thread reply, when I click it, it doesn't bring me to the post in the e-mail alert, instead it routes me to some seemingly random other point in the thread, several posts prior to the one in the email. Sometimes it puts me right in the middle of a post, not even at the top or bottom. then I have to scroll down to get to the latest post. Really annoying. Anyone else see this effect?
 
The link in the email should contain a post anchor (#post-123) to go straight to the post. Is it not going straight to that post?

Normally you only get one notification for a watched thread until you next visit that thread. So multiple new replies should result in just one notification for the first new post which, in the case of multiple new replies, will likely be in the middle of a page as you say.

The only other thing that can mess this up is if you have changed this setting:

Admin CP -> Home -> Options -> Messages -> Messages Per Page
 
I haven't changed the messages per page, so that's not it.

The link in the email is the xxx/unread, but the thing is that it's a thread where I've read all the other posts, in fact I posted a reply, then someone else will post say 2 or 3 replies (or multiple people reply) and when I get the email alert for the first reply since I visited, I would expect it to take me to the post right after my last one, but it takes me to a post 3 up from my last reply, and puts me in the middle of that post.

Doesn't to it here. Makes me wonder if Tapatalk is the problem because that's the only other thing "reading" my posts.

I will have to pin this down. Because I can view the thread in Tapatalk and then later click the email link and it acts like this. If I subsequently click the email link again, it takes me to the last post in the thread. It's really odd. I've noticed this odd behaviour on other forums as well. Starting to think that Tapatalk is the culprit.
 
Yes, using FF.

I'll switch default browser to Chrome and see if it keeps happening.

It's odd that it doesn't happen consistently on all XF sites. Like I don't see it happening here to my recollection.
 
Nope. happening on Chrome as well.

Here's the link in the email

Neglect and scrounged together sump lighting
Code:
https://www.algaescrubbing.com/threads/neglect-and-scrounged-together-sump-lighting.716/unread

In this instance, when I click on the link, it resolves to

Neglect and scrounged together sump lighting
Code:
https://www.algaescrubbing.com/threads/neglect-and-scrounged-together-sump-lighting.716/#post-5317

Which in this case is post #10

But it bring me, both in Chrome and FF, to the middle of post #1 (to the picture of the piece of glass
 
This is, to some degree, a browser issue. The issue is that it scrolls you down and then loads all the images, which changes the height of the page. Traditionally, if you don't scroll in the interim, it would actually scroll you onload. We do have some code to attempt to emulate this, but it's fairly limited in terms of how we can do it.
 
When I clicked this link:

Code:
https://www.algaescrubbing.com/threads/neglect-and-scrounged-together-sump-lighting.716/unread

it brought me to the top of the page and resolved to the correct URL:

Code:
https://www.algaescrubbing.com/threads/neglect-and-scrounged-together-sump-lighting.716/

I was logged into your forum and I'm using Firefox on my iMac.
 
This is, to some degree, a browser issue. The issue is that it scrolls you down and then loads all the images, which changes the height of the page. Traditionally, if you don't scroll in the interim, it would actually scroll you onload. We do have some code to attempt to emulate this, but it's fairly limited in terms of how we can do it.
I seem to recall that it tends to do this on picture-heavy threads. So that might be the answer.

it would actually scroll you onload.
typo?
 
In this case, actually no. "Onload" was referring to the JS event by that name, which fires after all of the resources (such as images) on a page have loaded. That's when the page should be (roughly) static and the anchor can be at a known height. We actually have some code that tries to do this, but we disable it if there appears to be manual scrolling by the user. The scroll event may be firing erroneously--or firing from the initial anchor "jump"--but unfortunately we can't easily detect that.
 
Coming back to this. If this is a browser issue, how come it is not consistent from one site to the next?

For instance, this thread

Speed up your site with a CDN

which has a large image in it, does not cause the thread to "bump" downward after the image loads.

Other non-XF forums that I frequent don't have this issue - some with extremely heavy picture-loaded threads. The thread will load text, followed by picture after picture bumping the thread all over the place, but when all pics are loaded, it scrolls to the first unread (linked) post.

This is a particularly annoying issue. Could it have anything to do with image proxying?
 
here's another thread example with huge pics, but when I let it load without bumping the mouse wheel, after it loads the pics, it scrolls right to the unread post.

60 Cube with Algae Turf Scrubber

This leads me to believe that it is something specific to my site settings that is causing this. Or maybe the style or style settings. Whatever it is, something is causing it.

Happens on mobile too BTW.
 
There are a lot of variables and a lot of it is internal to browser behaviors. For example, I've had examples on your site that are noted as not working here scroll correctly on load. Equally, I've had times where it didn't work as expected, and this can very well be down to internal differences between the renders.

That said, it's certainly possible there are elements related to your modifications. You could try on the default style to see if that makes a difference.
 
I'm still experiencing this issue on both the forums I admin. On the reef2reef.com forum however, it literally never happens. Using the same browser, same PC. In fact it happens on my iPhone as well. This makes me wonder if it has to do with image proxy settings or something.

I have contact R2R admins to see what their settings are but if anyone can tell me if the following settings might be causing this issue your insight would be appreciated.

ACP-messages.webp
 
I had some free time to mess with this and I think I've figured out that it's connected to the trailing /unread on the URL. I also think it's connected to the time since you last viewed the thread because I'll be damned if it works fine on subsequent tries. But that might indicate image proxy issue.

Since you can't "see" this without waiting long enough for something to reset, I'll have to describe what I am seeing.

I have a multi-page thread, say, 9 pages. On page 7, the 2nd post is picture heavy. Someone quoted a post further down on that page (say, the 10th post on the pate) and the post with the quoted section is on page 8 for instance. After some time, I click the little up arrow in the quote box of the post on page 8 to go back to the original quoted post on page 7.

What happens, the first time I do this, is that the "landing" ends up being smack in the middle of one of the pictures in the 2nd post on page 7. But it's always the exact same spot in that post every time this happens. I know because this is a particular post that I had to keep going back to now and then in preparation for an event we were having. Every time I went to it, it put me in a weird place and I had to scroll down quite a ways (approximately the same # of pixels as the sum total height of all the photos in that thread if I had to guess) in order to get to the post that the quote-link should have taken me to.

Now, immediately I go back to the post on Page 8 where the quote is located and click it again. This time, and every subsequent time, it takes me directly to the landing point I would expect - with the permalink at the top right corner of the page.

This all above was on Firefox which is what I normally use.

Now I switch to Chrome and log into my account. I go to the same page 8 post, click the quote link, and it takes me to Page 7 in the middle of the photo. Nearly the same spot. Now here's the really odd thing, when I resize that window, the anchor point moves. I have 2 monitors so I wanted to drag it over to my 2nd monitor and see if anything changed and it did. Without scrolling the mouse wheel or dragging the slider at all, when I resize the window is jumps all around. When I go back to the original size window, it goes back to the (incorrect) loading point. It's really weird.

Then I go back to page 8 with the quoted post link and click it again...this time it lands me at a different point! Next time I try, it lands me at the picture again (same as first try). A few tries later, it lands me at the target post where it should. Subsequent tries put it in the middle of the photo again (same spot every time). So Chrome is more random, so now that points to a browser issue.

But again I go back to this: I don't see this issue ever happening on several other "big board" reefkeeping sites that I frequent, everything on those sites works like clockwork no matter what browser I'm using, and no matter how long it's been since I visited a certain thread, and no matter how long it's been since I looked at a previous page of that thread that was picture heavy. Everything works exactly at expected all the time every time. Except my sites.

Someone else has got to have seen this effect.
 
I've encountered this issue multiple times as well. I've also had it reported to me by other users. As @Floyd R Turbo said previously it is particularly noticeable where there is a lot of image heavy content. I generally only use the latest version of Firefox/Window 10 for browsing so I can't say if it's browser related or not. I can't replicate it by posting a direct link to a post within a thread, I've only noticed it when viewing new content from the 'New Posts' link but it happens to me on multiple XenForo based forums. One thing I have noticed is that when it happens the content I'm presented with will often be the same content until a new page is reached.

It's a huge irritation which I've spent many hours trying to troubleshoot but as I can't replicate a situation where the issue can be demonstrated I can only really add some weight to what's already been posted here.
 
Right now I think I may have a replicatable situation. Will play with it a bit. Problem is, the one I reference is in a private area of a forum. But there are 2 where it is happening to me right now on public threads. Check them out

https://www.greateriowareefsociety....off-potluck-who-has-the-cooking-skills.26208/

https://www.greateriowareefsociety.org/threads/gyre-problem-with-shaft-and-motor.26211/

You'll have to register and subscribe to the threads and then try a few browsers. Like you said, multiple pages might cause it. It hasn't been for me on these 2 threads today, every new reply I get, when I click the email link it hoses up the position consistently
 
Back
Top Bottom