Odd behaviour of the "New Topics" count?

AI-generated summary

In a discussion titled "Odd behaviour of the "New Topics" count?", thorbenegberts reports inconsistent behavior in the "New Topics" counter on their Discourse forum, noting it resets unexpectedly despite using the setting "Consider topics new if I haven’t viewed them yet". codinghorror suggests there may be a cap on how many new topics are tracked. sam confirms this: Discourse enforces a global hard limit of 500 unseen topics to prevent performance issues, defined in a hidden site setting. This limit applies site-wide, not per user, and is based on the 500th most recently bumped topic globally — any newer topics beyond that are not counted as "new" for anyone. Mittineague notes the limit is rarely problematic in practice and suggests displaying "500+" for clarity. thorbenegberts clarifies that their observed counts never exceeded 78, even over weeks, and wonders if min_new_topics_time affects this — sam confirms the behavior is intentional and global, not user-specific. thorbenegberts concludes no adjustment is needed, seeking only to explain the behavior to users. sam offers to raise the limit to 1000 or 2000 if desired, but warns of potential performance trade-offs. The consensus is that the behavior is by design to maintain performance, not a bug.

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. · GitHub 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”

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:

We allow for max_new_topics total on the site.

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.

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?

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.

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

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