Odd behaviour of the "New Topics" count?

Hi there,

one of our users reported an odd behaviour of the “New Topics” count in /new/. He reported it in January. I tried to reproduce it ever since to recognize a pattern, but I wasn’t able to. So I’m reaching out to you.

The “new” count is correct for some days but seems to be reset at some point. Is there some kind of (maybe wanted) mechanism that resets the “new” count after a few days? Or does the query only display new topics within a certain time span?

Here my settings:

(Version: Discourse 2.0.0.beta4 - GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. version fa95699fde72c8a0028a2195217da05066f0eaf8, hosted instance forum.plentymarkets.com)

I believe if the user lets the new count pile up endlessly, eventually they will hit a cap. @sam would probably know specifics.

Remember the default in Discourse is “consider topics new when … created in the last 2 days”

1 Like

Yes! “Consider topics new if I haven’t viewed them yet” has some built in safeguards to avoid trading in enormously expensive queries.

In particular:

https://github.com/discourse/discourse/blob/f5a3be750c99f3ba89126c61dda51df0571dbe4e/app/jobs/scheduled/periodical_updates.rb#L46-L50

We allow for max_new_topics total on the site.

https://github.com/discourse/discourse/blob/master/config/site_settings.yml#L1163-L1166

This is a hidden site setting which is hardcoded to 500. We can probably bump it up on your site a bit, but it risks introducing performance problems.

4 Likes

I’m not really seeing where there would be a great need to “show all of them”.

I set my preferences to “new when haven’t read them” and was presented with more than enough. True, the number said 500 and after reading a bunch the next time it again said 500. So I suppose it could be a bit confusing to those that don’t understand what’s going on. But it isn’t like I read anywhere near 500 all in one go let alone if there had been all of them.

Maybe simply having a plus 500+ would be good enough?

1 Like

Okay, and in combination with SiteSetting.min_new_topics_time some new topics will “disappear”, so the actual count of unseen topics can be over 500.

Explains a lot to us. Thanks for the information! For some people this won’t be ideal, but I understand the need for it.

1 Like

I can probably bump it up to 1000 or 2000 on your site if you want, but we need a hard limit to keep performance reasonable

2 Likes

Thanks, but I think there is no need for that.

What I don’t fully understand is that in my tests I never exceeded a count of 78 over 3 weeks. In between it dropped to 64, 59 and even 48, even if I didn’t read that many topics (or did I?). As I mentioned above, I use the “I haven’t viewed them yet” setting. In my understanding new topics would have to pile up till 500 if I’m an inactive user, but thats not the case. As I suggested in my previous post, does it somehow interfere with the SiteSetting.min_new_topics_time property?

I don’t think thats a bug, I just want to say something plausible to our customers :wink:

Yeah, I get why it is confusing, the number is global not per user, we hunt for the 500th topic that was bumped globally, and the never allow any new topics beyond that

5 Likes

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