PERF: Dematerialize topic_reply_count (PR #9769)

Instead of updating topic_reply_count on every post creation, deletion, and ownership change, calculate it from scratch during trust level promotions. Additionally, replace the topic_count + reply_count on the client with any_posts, as it was only ever compared to 0.


the column is now useless, drop it from the db

We use camelCase on the client-side (except very few places) :wink:


Why *2 and not just +1?

Looks like this is a new condition. Is it intended?

I think >= would be more correct here.

    return numReplied >= minReplied;

If I’m doing a +1, then > would be correct, no?

TL3 requirements checked for .public_posts

TL3 requirements checked for .public_posts

I’m always off by one :stuck_out_tongue:

TL2 didn’t as far as I know, but I guess it’s better that way :+1:

This pull request has been mentioned on Discourse Meta. There might be relevant details there: