Kakifrucht jordanjay29 Can you add a post to the discussion and see if the counter increases by 2? Just closing the discussion doesn't seem to reproduce it on my end either, but posting seems to then trigger a recount that includes the closing action. I suppose you are on beta-8.1?
datitisev Kakifrucht The counters now queries the database on post and discussion actions respectively, so a new post shouldn't increased the counter by 2. EDIT: Just saw that Jordan managed to reproduce it. 🤔 Is it because of a deleted post? All posts and discussions are counted by Flarum now.
jordanjay29 Ahh, now it happened. Check links again, post count is now 4, only three listed. Nice bug find.
Kakifrucht datitisev In this case it would count the closing action after you post. It shouldn't count the closing action as a post.
jordanjay29 datitisev EDIT: Just saw that Jordan managed to reproduce it. 🤔 Is it because of a deleted post? All posts and discussions are counted by Flarum now. That forum is brand new, you can see every single post that exists. Issue created: flarum/core1695
datitisev Kakifrucht Oh, I think I know the reason. Is perhaps the post count including actions, i.e. renaming a discussion, instead of posts of type 'comment' ?
Kakifrucht datitisev Yes, it just counts every action recorded in db. So, Flarum seems to use a query like this: SELECT COUNT(*) FROM `posts` WHERE user_id=1; when it should probably be SELECT COUNT(*) FROM `posts` WHERE user_id=1 AND type="comment";
Pollux I just made the observation, that event posts are counted as new (unread) posts but not in the total count of posts after having viewed the new posts. This happened in a Beta 7.2 installation.
matteocontrini Hello. This is an old discussion, but I have a question. After this issue was fixed, was the count for previous discussions updated in some way? And, since I'm leaning to "no", is there a way to force the refresh of the counts?
clarkwinkelmann matteocontrini the count is updated everytime the user creates or deletes a post. For active users, the count should be up to date. For users who haven't posted anything since the fix was released, the old value is likely still present.
matteocontrini clarkwinkelmann ah sorry I was convinced this issue was about the comment_count field on a discussion, while it's actually the count for the user. Sorry for the confusion. For the discussion case, instead, since the way the count is computed changed between beta7 and beta8, I guess old discussions weren't updated? EDIT: maybe it actually didn't really change, except for the private discussion check