Too Many Unread Posts?

20 Replies, 2576 Views

No problem. I think it's probably not a coincidence that the original problem was reported on 11th March and the unexpected posts were from a forum where the latest post was dated 10th March, one year earlier. i.e. this post originally:
https://psiencequest.net/forums/thread-h...g-to-posts
and today's results, this one: https://psiencequest.net/forums/thread-hellevator-ride

I suspect it is something about those dates being one year different to the current date which trips something.
[-] The following 1 user Likes Typoz's post:
  • Laird
Yep, I reckon you're definitely on to something there.

Haven't yet restored the backup locally but will let you know what I find when I do.
[-] The following 1 user Likes Laird's post:
  • Typoz
A quick update on this, Typoz: I've now restored the backup locally and I can replicate the problem under your account. I can see in an immediate sense why the extra threads are being shown but I haven't yet worked out how the situation which is that immediate problem came to be.
(This post was last modified: 2020-06-21, 10:09 AM by Laird.)
[-] The following 1 user Likes Laird's post:
  • Typoz
(2020-06-21, 10:07 AM)Laird Wrote: A quick update on this, Typoz: I've now restored the backup locally and I can replicate the problem under your account. I can see in an immediate sense why the extra threads are being shown but I haven't yet worked out how the situation which is that immediate problem came to be.

Thanks for your efforts Laird, I appreciate it. Though it is also not the most urgent concern, so don't lose too much sleep over it.
[-] The following 1 user Likes Typoz's post:
  • Laird
(2020-06-02, 07:29 PM)Typoz Wrote: I suspect it is something about those dates being one year different to the current date which trips something.

Yep. Spot on.

The problem in essence is that the View Unread Posts plugin does not respect the core MyBB setting "Read Threads in Database (Days)". And there's no prizes for guessing what the value of that setting on PQ is right now....

That setting stipulates the number of days after which to delete/ignore the user's "last read" entries for each forum/thread.

So, the View Unread Posts plugin says, "Hey, there are no entries to indicate when Typoz last read these threads in these forums - therefore they are unread".

But the core MyBB code says, "Yeah, but the date-time of the last posts in each of those threads is longer ago than the 'Read Threads in Database (Days)' setting, so I am forced to assume that they are read".

And thus, the "unread" but "read" threads that you saw in the search results appeared due to the View Unread Posts, but were marked as read due to core MyBB code (in search.php).
[-] The following 1 user Likes Laird's post:
  • Typoz
An interesting follow-up question is: if the View Unread Posts plugin does not respect the core MyBB setting "Read Threads in Database (Days)", and this is why you were seeing a bunch of read posts showing up in an "unread" list, then why isn't this happening more often, and to other members?

The answer seems to be that if a member visits a forum in which s/he has read all the threads, then the user's "last read" entry gets set for that forum (in line 1438 of forumdisplay.php).

So, it seems that from this we can deduce that at the time these "unread" read posts showed up for you, Typoz, you had not visited the Dreams subforum for over a year. Is that plausible?
[-] The following 1 user Likes Laird's post:
  • Typoz
(2020-07-05, 04:16 AM)Laird Wrote: So, it seems that from this we can deduce that at the time these "unread" read posts showed up for you, Typoz, you had not visited the Dreams subforum for over a year.

Actually, this need not be the case. There is some other code introduced by the View Unread Posts plugin (line 183 of inc/function_indicators.php) which causes the "last read" entry not to be set by the above-mentioned line 1438 of forumdisplay.php.

It seems to me that that line (183 of inc/function_indicators.php) should be not what it is:

PHP Code:
            $cutoff $mybb->user['lastmark']; 

but rather:

PHP Code:
            $cutoff max($cutoff$mybb->user['lastmark']); 

This is another case of the View Unread Posts plugin ignoring the "Read Threads in Database (Days)" MyBB setting (which $cutoff reflects at this point in the code).
(This post was last modified: 2020-07-05, 05:05 AM by Laird.)
[-] The following 1 user Likes Laird's post:
  • Typoz
(2020-07-05, 04:16 AM)Laird Wrote: An interesting follow-up question is: if the View Unread Posts plugin does not respect the core MyBB setting "Read Threads in Database (Days)", and this is why you were seeing a bunch of read posts showing up in an "unread" list, then why isn't this happening more often, and to other members?

The answer seems to be that if a member visits a forum in which s/he has read all the threads, then the user's "last read" entry gets set for that forum (in line 1438 of forumdisplay.php).

So, it seems that from this we can deduce that at the time these "unread" read posts showed up for you, Typoz, you had not visited the Dreams subforum for over a year. Is that plausible?

Yes, it is entirely plausible that I hadn't visited that particular subforum for a year or more. (though your other post may make this less important?).

I did wonder why no other member was experiencing this particular issue. Perhaps it is that I habitually, almost always, use the "unread posts" feature as my way of accessing the forum. I know there are other ways which perhaps others may be using the forum.

I'm following the gist of your explanation of what is going on. What I'm not quite sure of though is this. What if I only visited the forum once every few months. Would I still see this phenomenon, or is it dependent on my clicking the button on a particular date (or within a narrow range of a few days)?
(2020-07-05, 12:36 PM)Typoz Wrote: Yes, it is entirely plausible that I hadn't visited that particular subforum for a year or more. (though your other post may make this less important?).

Yep, my other post makes it irrelevant when you last visited that particular subform, and so we still have no answer as to why this bug is manifesting so rarely.

I am unable to offer an answer at this point, beyond noting that contributing factors are (1) that the value of "lastmark" for your account is the sixth-lowest of any forum member, and (2) that the value of the "dateline" column for the relevant forum (Dreams) for your account in the mybb_forumsread table was NULL (which is curious in itself, because that column is set to disallow NULL values).

The value of "lastmark" reflects the last time the member clicked a "Mark all read" link to mark every thread in every forum read, and the "dateline" column reflects the last time all threads in the given forum were marked read for the given member (and is sometimes set automatically, as I mentioned in a post above, although in that post I referred to it as "last read").

(2020-07-05, 12:36 PM)Typoz Wrote: I did wonder why no other member was experiencing this particular issue. Perhaps it is that I habitually, almost always, use the "unread posts" feature as my way of accessing the forum

I don't think it's that, but at this point I am kind of confused beyond what I've shared so far, so I can't be sure. I also use the "View Unread Posts" feature almost exclusively and have not experienced this bug.

(2020-07-05, 12:36 PM)Typoz Wrote: What if I only visited the forum once every few months. Would I still see this phenomenon, or is it dependent on my clicking the button on a particular date (or within a narrow range of a few days)?

My understanding (amidst the confusion!) is that yes, you would still see this phenomenon if you visited the forum at any time after the year had elapsed (since the 10th of March 2019) - it's not dependent on frequency of visiting.

Unfortunately, that's the most I have for you at this point. Though the diagnosis is incomplete, I wanted to at least get back to you within a reasonable timeframe.
(This post was last modified: 2020-07-14, 06:22 AM by Laird.)
[-] The following 1 user Likes Laird's post:
  • Typoz
Thanks again Laird. I would add that other than the initial confusion I had the very first time, this bug isn't something which troubles me - I think we could live with it. Though as a former programmer myself I know how having such quirks leads to as feeling of unease, sometimes there's an urge to get to the bottom of things.

I'd add that I think I have never clicked a "Mark all read" link on this forum. (I've used it on other forums where I have no interest or intention of reading most of the posts - which is not the case here.)
[-] The following 1 user Likes Typoz's post:
  • Laird

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)