*

Offline TomInAustin

  • *
  • Posts: 1367
  • Round Duh
    • View Profile
Unread Posts not working
« on: July 02, 2020, 05:27:37 PM »
On the main forum page, clicking the unread posts in the "-Unread PostsFlat Earth Discussion Boards" shows no unread posts but entering "Flat Earth Theory" shows unread posts.

Not earth (flat or otherwise) shattering but annoying.








It works on the bottom 2 and not on the upper two sections.  Odd
« Last Edit: July 02, 2020, 05:30:26 PM by TomInAustin »
Do you have a citation for this sweeping generalisation?

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 16073
  • (◕˽ ◕ ✿)
    • View Profile
Re: Unread Posts not working
« Reply #1 on: July 02, 2020, 08:04:17 PM »
So, the function that generates these is an amazing 900-liner featuring awe-inspiring comments from the original authors like "// Sanity... where have you gone?"

I hope to set an expectation here. I'm not sure what's going wrong, but I can confirm that the results "seem wrong" from my point of view too. However, figuring out wtf is going on may turn out to be trivial, or it may turn out to be impossible.
Read the FAQ before asking your question - chances are we already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

If we are not speculating then we must assume

*

Offline TomInAustin

  • *
  • Posts: 1367
  • Round Duh
    • View Profile
Re: Unread Posts not working
« Reply #2 on: July 02, 2020, 08:11:33 PM »
So, the function that generates these is an amazing 900-liner featuring awe-inspiring comments from the original authors like "// Sanity... where have you gone?"

I hope to set an expectation here. I'm not sure what's going wrong, but I can confirm that the results "seem wrong" from my point of view too. However, figuring out wtf is going on may turn out to be trivial, or it may turn out to be impossible.

This is a recent development.  As recently as last week it worked fine.  I would look for recent check-ins.  Unless something seemingly unrelated broke it.

I may steal "// Sanity... where have you gone?" for all future code comments!

Do you have a citation for this sweeping generalisation?

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 16073
  • (◕˽ ◕ ✿)
    • View Profile
Re: Unread Posts not working
« Reply #3 on: July 02, 2020, 08:31:41 PM »
This is a recent development.  As recently as last week it worked fine.
This is useful information. We did make a bunch of changes recently, none of which I would immediately think might be related, but it gives us something to look through.
Read the FAQ before asking your question - chances are we already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

If we are not speculating then we must assume

*

Offline TomInAustin

  • *
  • Posts: 1367
  • Round Duh
    • View Profile
Re: Unread Posts not working
« Reply #4 on: July 02, 2020, 08:33:48 PM »
This is a recent development.  As recently as last week it worked fine.
This is useful information. We did make a bunch of changes recently, none of which I would immediately think might be related, but it gives us something to look through.

glad to be of help instead of a pain in the a for a change
Do you have a citation for this sweeping generalisation?

*

Offline xasop

  • Administrator
  • *****
  • Posts: 9776
  • Professional computer somebody
    • View Profile
Re: Unread Posts not working
« Reply #5 on: July 03, 2020, 05:51:37 AM »
Are you sure this used to work? On my test forum, if I check out the code from February 2019 (which is as far back as I can go, otherwise the code to check the new-style password hash isn't there yet), I see identical behaviour. It's also worth noting that my test forum is using a copy of the database from over a month ago, so it can't be a recent change to the database that caused it.

Of course, it is always possible that a recent code change caused unread posts to be permanently flagged as read so that reverting it doesn't fix it, I guess.

Edit: Actually, making new posts (both in existing threads and new threads) with a different user account does cause them to show up in Unread Posts, so there's something more deeply broken here.
« Last Edit: July 03, 2020, 05:59:20 AM by Пардисфла »
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 16073
  • (◕˽ ◕ ✿)
    • View Profile
Re: Unread Posts not working
« Reply #6 on: July 03, 2020, 01:03:07 PM »
Yes, an early investigation on my end also suggests that it's impossible for this to be a recent breakage.

I have a hunch as to what might be going on, but this is mostly untested and unsubstantiated for now, so take it with a massive grain of salt:

The code that generates these "Recent Posts" tries to keep database queries small in size by only checking the most recent few hundred posts. If the unread post you couldn't see was relatively old (say, there were a few hundred posts made in-between), it would never be found by it. For example: if I mark a recent thread as unread, it starts showing up in the "Recent Posts" for the right category, but if I go a few pages down and mark a thread in there, this won't be reflected in "Recent Posts" at all.

I am not yet sure if the significant factor here is the ID of the OP, or the ID of the most recent post in that thread. I suspect it might be the former - when I marked robinofoxley's thread (the one you pointed to) as unread, it did not show up in "Recent Posts", possibly because the thread itself is "old".

As I said before, this is a behemoth of a function, and reading it while sober makes me ache, so I can't confirm this with any confidence just yet, but it seems like a very likely explanation for what's going on.

I had a similar disagreement with SMF's devs back in 2015. The "Status Notices" list in the sidebar of our homepage wouldn't work, because their code would only check the last ~175 posts on the entire forum, and we usually had more than 175 posts between notices being posted. I suggested removing the restriction, but in short I was told that:
  • The problems we're encountering will never happen on a big forum.
  • The project leader runs multiple forums and has never had a problem, therefore the problem doesn't exist.
  • Lifting these restrictions would KILL YOUR SERVER!!1!! because of VERY LARGE DB QUERIES!!!!!!
  • It is rude and presumptuous of me to point out that SMF routinely performs large db queries, and that it's the DBMS's job to handle those correctly

In other words, it is unlikely that SMF will be fixing it soon, but we should either lift or greatly slacken these limits to see if it helps.
« Last Edit: July 03, 2020, 01:07:04 PM by Pete Svarrior »
Read the FAQ before asking your question - chances are we already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

If we are not speculating then we must assume

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 16073
  • (◕˽ ◕ ✿)
    • View Profile
Re: Unread Posts not working
« Reply #7 on: July 03, 2020, 01:23:19 PM »
Hmm, no, that might be part of it, but it's not quite the cause. It actually looks like there are two ways to display "Recent Posts".

The button currently displays "Recent Posts" since your last visit, whatever that means. Probably something like "if you've read a post with a higher ID, we won't show you this one anymore". Whatever it actually is, I suspect that the definition of "recent" is the issue here.

There is a secondary function which displays all unread in a category (FE boards in this case) which appears to show a much more complete listing.

It might be an idea to use that one by default. The first time around it will probably spam people with ancient unread topics, but you have an easy way of marking them all as read. The downside is that if you don't always mark everything as read, old threads you don't care about will clutter your view. The upside is that you'll never miss a post.
Read the FAQ before asking your question - chances are we already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

If we are not speculating then we must assume

*

Offline xasop

  • Administrator
  • *****
  • Posts: 9776
  • Professional computer somebody
    • View Profile
Re: Unread Posts not working
« Reply #8 on: July 03, 2020, 02:09:54 PM »
In other words, it is unlikely that SMF will be fixing it soon, but we should either lift or greatly slacken these limits to see if it helps.

I think we should completely ignore whatever crap SMF upstream wants to push, barring future security fixes to the 2.0 branch. Our two-man team is more than capable of maintaining our fork to a higher standard.

It might be an idea to use that one by default. The first time around it will probably spam people with ancient unread topics, but you have an easy way of marking them all as read. The downside is that if you don't always mark everything as read, old threads you don't care about will clutter your view. The upside is that you'll never miss a post.

Agree. This is what I would expect a button that says "Unread Posts" to display.
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 16073
  • (◕˽ ◕ ✿)
    • View Profile
Re: Unread Posts not working
« Reply #9 on: July 03, 2020, 03:35:18 PM »
The button currently displays "Recent Posts" since your last visit, whatever that means. Probably something like "if you've read a post with a higher ID, we won't show you this one anymore". Whatever it actually is, I suspect that the definition of "recent" is the issue here.
I am now confident that this is the source of the issue.

SMF keeps track of what the highest post ID was at the time of your "last visit", counting re-visits within a 5-hour window to be part of the same "visit". It, uh, actually does something more complicated and less sensical than that (it's basically impossible to define what "recent" is), but this is close enough.

If there are unread posts which are older than what was available during your "last visit", they will never be listed in "Recent Unread Topics". Even if you haven't read the thread. Even if you actively *marked it as unread* by yourself. It does not fall within the definition of "recent" as decided by SMF.

So, we have several options:
  • We can argue that a button that says "Unread Posts" should display ALL unread posts in a category. This is easily done by redirecting the button to already existing functionality. There will be some initial inconvenience since some users no doubt have thousands of old unread threads which will suddenly appear in that list. However, once they've cleaned it up once, it will then continue to work in a way anyone would experience.
  • We can redefine what "recent" means. Instead of saying "Show me posts which are unread, which also fall within a timeframe which is not intuitively predictable, due to its reliance on the creation time of the post you last saw, but only if that happened more than 5 hours ago. So, y'know, maybe hours, maybe days, could be months if you haven't logged in in a while, who knows my dude" we could say "Show me posts which are unread and less than a month old". This has the benefit of not displaying truly ancient stuff, and should feasibly capture anything that a regular user might still want to read.
  • We can conclude that the function works as intended. It does display recent unread posts, even if a normal human won't be able to pinpoint exactly when "recent" is.
In scenarios b and c, I would also advocate for more clearly signposting that "Unread Posts" means "Recent Unread Posts". Probably just throw in a "Recent" there.
« Last Edit: July 03, 2020, 03:51:46 PM by Pete Svarrior »
Read the FAQ before asking your question - chances are we already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

If we are not speculating then we must assume

*

Offline TomInAustin

  • *
  • Posts: 1367
  • Round Duh
    • View Profile
Re: Unread Posts not working
« Reply #10 on: July 03, 2020, 05:30:37 PM »
Are you sure this used to work? On my test forum, if I check out the code from February 2019 (which is as far back as I can go, otherwise the code to check the new-style password hash isn't there yet), I see identical behaviour. It's also worth noting that my test forum is using a copy of the database from over a month ago, so it can't be a recent change to the database that caused it.

Of course, it is always possible that a recent code change caused unread posts to be permanently flagged as read so that reverting it doesn't fix it, I guess.

Edit: Actually, making new posts (both in existing threads and new threads) with a different user account does cause them to show up in Unread Posts, so there's something more deeply broken here.

While I can't say if it worked correctly or not,  it did work.   I always clicked the Unread posts on the "Flat Earth Discussion" and got a list.  This worked until a week or so ago.   The reason I noticed was that there were no new posts in the "Flat Earth Discussion Boards" for days early this week and I clicked in and saw plenty.

Do you have a citation for this sweeping generalisation?

*

Offline TomInAustin

  • *
  • Posts: 1367
  • Round Duh
    • View Profile
Re: Unread Posts not working
« Reply #11 on: July 03, 2020, 05:39:21 PM »
Are you sure this used to work? On my test forum, if I check out the code from February 2019 (which is as far back as I can go, otherwise the code to check the new-style password hash isn't there yet), I see identical behaviour. It's also worth noting that my test forum is using a copy of the database from over a month ago, so it can't be a recent change to the database that caused it.

Of course, it is always possible that a recent code change caused unread posts to be permanently flagged as read so that reverting it doesn't fix it, I guess.

Edit: Actually, making new posts (both in existing threads and new threads) with a different user account does cause them to show up in Unread Posts, so there's something more deeply broken here.

While I can't say if it worked correctly or not,  it did work.   I always clicked the Unread posts on the "Flat Earth Discussion" and got a list.  This worked until a week or so ago.   The reason I noticed was that there were no new posts in the "Flat Earth Discussion Boards" for days early this week and I clicked in and saw plenty.

It's interesting, I just clicked unread in the FEDB section and got one hit



That post was from today.   Clicking into FEI I see many unread posts but the next newest was June 7.  That seems to validate your date stamp theory.




In FE Projects there is a post on June 30th that does not show in the unread.

Do you have a citation for this sweeping generalisation?