flarum / issue-archive

0 stars 0 forks source link

User Page Discussion Count differs from discussions user's able to see #321

Open dsevillamartin opened 8 years ago

dsevillamartin commented 8 years ago

I didn't really know how to name this, sorry.

PROBLEM

Whenever someone deletes the first post of a discussion, another user can still see that discussion as part of the discussion count on the user's page, but whenever they go to see the actual list of discussions, it says there're no discussions there. flarum/core#1006

STEPS

  1. Create a discussion on a user's account with no discussions
  2. Delete the first post in whatever account
  3. Log out or login into any other account which doesn't have permissions to see deleted posts and/or discussions
  4. You will see it says 1 discussion but shows none
tobyzerner commented 8 years ago

Great bug report, thanks :)

adesnmi commented 8 years ago

What's the status on this, thinking of taking this on as my first PR.

dav-is commented 8 years ago

It's important the user's discussion and post count reflect the number of posts the user has made. If a post is hidden from the user viewing the post, the user should see the same number and should see a template post listing all the discussions they don't have permission to see. The API should be able to tell users the post was restricted instead of not found.

franzliedke commented 8 years ago

@muyiwaolu Still interested? Feel free to take this on!

dav-is commented 8 years ago

@franzliedke It think it's important we preserve the user statistics. I think the number should stay but I think the API should output empty placeholder posts or discussions when they don't have permission. If users are being sorted by number of discussions or posts in the user list, we don't want the list to be different for users who can view more posts. I've heard about widgets that would display the most active users. By changing the post_count based on permissions you're effectively manipulating the forum's statistics.

Could we mark this as needs discussion?

jordanjay29 commented 8 years ago

@dav-is has a fair point for user statistics, but I'm not sure the board-wide statistics actually need to be considered here. The number of discussions listed on a user profile could simply be a total count grabbed from the list to be displayed depending on permissions, not necessarily the total number contained in the DB. This maintains the obscurity of secure forums that you may not have permission to access (and read posts within), while not confusing members by having problems (seemingly) with simple arithmetic.

The display on the user profile does not necessarily need to be the user's post count. It can instead be considered a total number of posts listed on the profile (which can be permissions-curated).

Any widgets or site statistics could pull from the entire post count as per normal.

dav-is commented 8 years ago

Except loading all the posts from a certain user and testing to see if they have permissions takes a long time. That's why the post count is controlled by an event listener. @jordanjay

franzliedke commented 8 years ago

@tobscure What are your general thoughts on what the UI should look like here?

tobyzerner commented 6 years ago

I'm leaning towards the idea that the post count should only include posts that are visible to the public.

Say I'm viewing a user's profile. The post count is shown as 7 but I can only see 2 posts. Now I know for a fact that the user has been active in a private section of the forum – I know for a fact that a private section of the forum exists and that user is included in it. I should never be able to know that information with 100% certainty, but I do because of the post count.

Another issue arises with private discussions: if I wanted to inflate my own post count, I could start a private discussion with myself, post in it a million times, and no one would be able to stop me.

So I think before we increment the post count, we should check to see if the post that was just made is visible to the level of membership that is required to view user profiles, and only increase the post count if it is.

Then of course we would have an issue where the number of posts displayed could be greater than the post count number. But at least there is no privileged information being exposed. Perhaps we could have something in the UI (a tooltip or something) to indicate that the post count only counts public posts.

jordanjay29 commented 6 years ago

@tobscure how do other forums count total (including private forums) posts without this issue? I think post count as an absolute is a normal thing in a forum, and dealing with the consequences of that knowledge is a task for the forum administrator, not the forum software.

The spamming in a PD is a good point, though. Maybe PD discussions shouldn't count towards post totals? Is that a change that @luceos can make to Byobu instead?

franzliedke commented 5 years ago

I personally think this is fine, (as long as is_private posts are filtered out). Both in terms of performance and consistency. But it needs to be explained in the UI - maybe like GitHub does this below the contributions matrix ("Learn how we count contributions")?

PeopleInside commented 5 years ago

In my forum I have created private and public post. Why no message are show? https://community.peopleinside.it/u/peopleinside

There are public message to show, is not show. Seems counter and list is not working very well or i cannot understand.

UPDATE: maybe this issue is present because in some tag i decide to hide the post to be showed in All discussions. Seems this post are not included in the count. (possible bug)

askvortsov1 commented 3 years ago

Related: https://github.com/flarum/core/issues/2240