New Indicator is showing wrong numbers again

(from TDWTF) #1

Something seems to be amiss with the “New (X)” indicator again.
I know there are topics with a similar problem but my recreation steps don’t require clicking “Top” or opening stuff in new tabs or anything like that.

On the other Discourse Instance (TDWTF) the New counter acts up for me when I click on it.
All Screenshots are taken after loading the page. There has been no editing the picture besides cropping the image to protect my privacy.

Recreating steps:
Open Discourse with New(X):

Click on New(7) to look at those new topics:

Wonder where the 30 comes from and click back to the main page:

Refresh (F5) to get the 7 back:

I can’t reproduce it on but I am unsure on how the bug comes to be in the first place.

The problem seems to be with discourse as I can recreate it (over there) with Opera and Firefox.
I also logged out and back in without any changes.

Filed Under: Fun fact, the screenshots were taken after I already went through this cycle once… it showed 9 before and I was looking for the 2 new ones I hadn’t seen yet

@Sam @codinghorror @eviltrout @PJH you guys are admins over at our instance, right? Can you confirm this is happening (via impersonating)?

My apologies if this is already fixed in newer instances.

New posts counter recalculated when filtering on new posts
(Dean Taylor) #2

The similar bug:

(from TDWTF) #3

Yeah, I found that via forum search. I would say that the nature of this bug is different to the one outlined in your topic.

I had @PJH impersonate me (while being on mobile)
These are the results:

Since mobile only loads half the topics it seems that having less than 30 new topics (within a certain period of time) but more New topics of older nature confuses the “New (X)”-indicator.
That would also explain why I cannot reproduce it here.
This is only a guess, though. I did not check the code for verification and would be interested in a developer reply.

Filed Under: I know you just wanted to point out the similar bug, @DeanMarkTaylor, but I had to take the oppurtunity to make this post

(Sam Saffron) #4

will impersonate you later today (or just download a db) can you keep the data around till I download?

(from TDWTF) #5

Knock yourself out.

I’ll probably go to sleep now and I can still activate the bug.

Filed Under: Sleep helps

(Sam Saffron) #6

I do have the backup and will have a look at it… just been swamped with some other stuff.

(from TDWTF) #7

I understand it’s not a high priority fix.
I can still activate it after our instance has been updated last night, so your backup should be good to go.

I still think the bug is that the New (X) Indicator usually doesn’t count topics which are too old (> 1 month) but clicking on the Tab brings them all up so the Indicator gets updated. The new number now corresponds to how many topics it loaded (since I have more than 30 it updates to the amount loaded: 30).
Scrolling down does not further increase the number as the update Indicator call seems to be bound to page load, not scroll down.

Filed Under: I hope this helps.

(from TDWTF) #8

I want to bump this topic since the bug is still active.
The whole “New” indicator is acting strangely, though.
I sometimes get “Phantom new counts” Probably because topics get unlisted.
The timeframe for a “New” topic to not be new anymore seems to be 54 days according to my experiment. (June 20th topic stopped triggering the New indicator today, August 13th) unless there is another mechanic at work besides date.
As this topic states I can still change my New counter by opening the New-tab.

I still understand that priorities probably lie elsewhere but some of the things (especially the phantom counts) do get very confusing.
Is there a point/version you guys are aiming to fix this?

Filed Under: I hope bumping this is okay since it’s been almost half a year.

(Sam Saffron) #9

Yeah its fine, I will chuck a priority-high on this cause I do want to get it sorted.

(Sam Saffron) #10

Your specific case (and @loopback0’s) is happening cause you have hit a hard tracking limit.

To protect the client and server we only count up to 500 new/unread items, it is trivial to “blow” the new number by setting treat new “I haven’t viewed them yet” which is what @loopback0 did.

In your case you just don’t use the web UI to read stuff (it appears) so you have accumulated an enormous amount of “unread” stuff.

I am considering a few ways of mitigating here.

  1. Getting rid of “I haven’t viewed them yet” option, it is both dangerous, sends a bad message and encourages inbox infinity which is never a good thing to have. Instead we can look at search filters or smarter “suggested topics” algorithms to pick out ancient awesome stuff you missed.

  2. I could possibly increase the limit from 500 to 1000 or 2000 or 5000, but at some point having this number too high means perf on client and server is impacted and the gain is just tiny. Are you ever going to dig through the 5000 items in your backlog? I don’t think so

  3. We could display a warning if you hit the hard limit telling you that you hit it and you got to clear unread or new to keep the function working.

(Dave McClure) #11

How about just showing the number as, for example, (500+) when its greater than the hard limit?

(Sam Saffron) #12

Its tricky cause 1 query gets both unread and new in one go… so I don’t know where to put the plus or even if either are truncated.

Simplest thing, I guess, is just to remove the limit … but it feels somewhat risky.

(Sam Saffron) #13

Fixed per:

(Sam Saffron) #16

Left open for 2 more days because people wanted to leave a bit more feedback.

(from TDWTF) #17

I might as well use this oppurtunity to give feedback:
1.) Let’s say - in theory - I’d be an idiot and ignore that message. What would happen? Does Discourse automatically truncate the new / unread topic-list for me? Am I slowing the server down? Does nothing happen besides a banner popping up? Would be nice if you cleared this up for me.
2.) Could you make “Dismiss New” and “Dismiss Posts” clickable links? Either to the New / Unread tab or directly dismissing things? Those two buttons are not on the frontpage where the banner is and therefor reuiqres some thinking / searching.
3.) Could you not automate this on a weekly task if a user has too much stuff? I know I am apparently the odd one here but it really seems like something the forum should just handle instead of telling the user to do things.

Filed Under: thanks for the fix

(Sam Saffron) #18

If you ignore then the numbers on New(#) and Unread(#) just dance around with very little logic. Server and client are safe. Your unread+new is “slightly” more expensive but we truncate so its ok.

Totally open for someone to make that change of creating clickable links but it is a bit of a PITA for an edge case so I skipped for now

I really like the idea of automating cleanup, we should run some queries to see how big the problem is in the wild but yeah great idea.

New / Unread counts missing when "too many tracked topics"
(Sam Saffron) #19

Ok I had to push this back down to 500, at a 1000 cap the server side query is 60ms at 500 it is 40ms … we have super fast SQL so in Digital ocean this would mean the diff between 200ms and 300ms.

(from TDWTF) #20

I dismissed all Unread and New topics here but the banner wouldn’t disappear. Even clicking on the Discourse-Logo to go back to the frontpage didn’t dismiss it. I think 2x F5 was neccessary. Might be a Cache problem but I am not sure.

Opera 30.0
Win 10

(Sam Saffron) #21

This topic was automatically closed after 2 days. New replies are no longer allowed.