Issue with "Jump to first unread" on the subscribed threads

Search This thread

Tungstwenty

Senior Member
Nov 1, 2011
1,830
4,512
Hi,

I use a lot the small arrow to the left of each subscribed thread to jump to the 1st unread post.
Most of the time it works correctly, but from time to time it will show me the start of the previous page and be left at the top, since the URL anchor is not present on that page.

The original link will be something like ".../showthread.php?goto=newpost&t=nnnnnn", which later resolves to ".../showthread.php?p=mmmmmm#postmmmmmm".
The problem is that "showthread.php", when processing with the "p=..." argument, sometimes fails and presents the previous page than it should. If I were to replace "p=mmmm" by "t=nnnn&page=yyy", leaving the anchor, it will work.

Based on some experiments, my guess is that that php, when processing in the p= mode, fails to handle the edge case where post_count mod page_length is 0. I tried it with multiple page sizes, and for the case I was trying it (before I read the post and now need to wait for another case like this), the post was a multiple of 10, 20, 30 and 40 but not 50. So, only after changing the page length to all values to confirm it was failing, and finally to 50, did it work properly.
I normally use 20 posts per page so the chances of the last unread being a multiple of that are pretty slim, but those using 10/page are likely to experience this more often.


FIX: The formula for the page count "page_number=((post_count - 1) DIV page_length) + 1" or equivalent. Currently there's an offset of 1 that probably nobody ever complained about (at least I didn't find any post mentioning this).

This occurs regardless of the selected theme, and also on the XDA app (the server side is probably the same, or shares that part of the code).


EDIT: It appears that the conditions are not that simple. Sometimes, *after* the situation has been triggered (or so it seems), refresh of the subscribed threads view won't solve it immediately. Even if my next unread post is, say, the 3rd on the next page, I'll still be taken to the top of the previous page and therefore not land on the right post (correct anchor, but wrong page). Something to do with caching, perhaps? :confused:
 
Last edited:

It_ler

Recognized Contributor
Aug 23, 2011
12,504
17,301
Samsung Galaxy S8
Samsung Galaxy S10
Hi,

I use a lot the small arrow to the left of each subscribed thread to jump to the 1st unread post.
Most of the time it works correctly, but from time to time it will show me the start of the previous page and be left at the top, since the URL anchor is not present on that page.

The original link will be something like ".../showthread.php?goto=newpost&t=nnnnnn", which later resolves to ".../showthread.php?p=mmmmmm#postmmmmmm".
The problem is that "showthread.php", when processing with the "p=..." argument, sometimes fails and presents the previous page than it should. If I were to replace "p=mmmm" by "t=nnnn&page=yyy", leaving the anchor, it will work.

Based on some experiments, my guess is that that php, when processing in the p= mode, fails to handle the edge case where post_count mod page_length is 0. I tried it with multiple page sizes, and for the case I was trying it (before I read the post and now need to wait for another case like this), the post was a multiple of 10, 20, 30 and 40 but not 50. So, only after changing the page length to all values to confirm it was failing, and finally to 50, did it work properly.
I normally use 20 posts per page so the chances of the last unread being a multiple of that are pretty slim, but those using 10/page are likely to experience this more often.


FIX: The formula for the page count "page_number=((post_count - 1) DIV page_length) + 1" or equivalent. Currently there's an offset of 1 that probably nobody ever complained about (at least I didn't find any post mentioning this).

This occurs regardless of the selected theme, and also on the XDA app (the server side is probably the same, or shares that part of the code).


EDIT: It appears that the conditions are not that simple. Sometimes, *after* the situation has been triggered (or so it seems), refresh of the subscribed threads view won't solve it immediately. Even if my next unread post is, say, the 3rd on the next page, I'll still be taken to the top of the previous page and therefore not land on the right post (correct anchor, but wrong page). Something to do with caching, perhaps? :confused:

+1
I have recognized this radom issue from time to time in xda app and on my PC.
The last few times when the jump to first unread post failed (jumped to the wrong post), there was a new page in the thread.
And instead of jumping to the first post on the last page of the thread, this action jumped to the first post on the second-last page of the thread (which was the last page before the new post was added).

But I also recognized the issue, that the jump to first unread post lead me to the last post of the thread, even if I have not read one or two posts before this last post.

The strange thing is that this function works correct most of the time ... only sometimes it misbehaves.
 

bitpushr

Retired XDA:Administrator
I'm having issues recreating this problem. We have a query that is similar to the one you said but a little bit different, also there are also factors that may be playing into consideration such as if a post was deleted and I'm wondering if that might be returning the incorrect offset. Can you give me steps to reproduce this again? Is it only threads where you have an unread post count = the number of posts per page?
 

gspears

Senior Member
Mar 15, 2011
848
293
Phoenix
Can you give me steps to reproduce this again? Is it only threads where you have an unread post count = the number of posts per page?

For me, using the 2010 interface, anytime on any thread, when I use the shortcut sent to me via an email sent by the XDA website, or use the jump to first unread button it will normally go to the top of the page of the last page I read. Then the next several times I use a shortcut to the thread it goes to that place even when more pages are used and I've read through them all. Then after several visits it will reset and go to the top of the last page I visited again.

I use 50 posts per page. And using the 2010 interface, it NEVER goes to the first unread post whether I use a shortcut from an email sent by XDA or using the button on the top of the page.

Thanks for the help.
 

Tungstwenty

Senior Member
Nov 1, 2011
1,830
4,512
Lately I haven't come across this issue, or at least I haven't noticed. I'm not sure if it's because the frequency I check the forum is quite lower, if something was fixed / updated on the server, if it's because I'm now using the 2013 Beta theme instead of the 2013 Beta - 1024 I used before, or something else.
I'll keep an eye out, though, and post here if I do come across this problem again with as much info I can infer from the situation.
 

arief03

New member
Mar 22, 2014
2
0
Hi,

I use a lot the small arrow to the left of each subscribed thread to jump to the 1st unread post.
Most of the time it works correctly, but from time to time it will show me the start of the previous page and be left at the top, since the URL anchor is not present on that page.

The original link will be something like ".../showthread.php?goto=newpost&t=nnnnnn", which later resolves to ".../showthread.php?p=mmmmmm#postmmmmmm".
The problem is that "showthread.php", when processing with the "p=..." argument, sometimes fails and presents the previous page than it should. If I were to replace "p=mmmm" by "t=nnnn&page=yyy", leaving the anchor, it will work.

Based on some experiments, my guess is that that php, when processing in the p= mode, fails to handle the edge case where post_count mod page_length is 0. I tried it with multiple page sizes, and for the case I was trying it (before I read the post and now need to wait for another case like this), the post was a multiple of 10, 20, 30 and 40 but not 50. So, only after changing the page length to all values to confirm it was failing, and finally to 50, did it work properly.
I normally use 20 posts per page so the chances of the last unread being a multiple of that are pretty slim, but those using 10/page are likely to experience this more often.


FIX: The formula for the page count "page_number=((post_count - 1) DIV page_length) + 1" or equivalent. Currently there's an offset of 1 that probably nobody ever complained about (at least I didn't find any post mentioning this).

This occurs regardless of the selected theme, and also on the XDA app (the server side is probably the same, or shares that part of the code).


EDIT: It appears that the conditions are not that simple. Sometimes, *after* the situation has been triggered (or so it seems), refresh of the subscribed threads view won't solve it immediately. Even if my next unread post is, say, the 3rd on the next page, I'll still be taken to the top of the previous page and therefore not land on the right post (correct anchor, but wrong page). Something to do with caching, perhaps? :confused:
BUMP! When will this be fixed?