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?
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?
Last edited: