-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting to hide PDs from "all discussions" page #183
Conversation
We originally removed this for performance reasons. Have you tested this at scale? |
I had a suspicion it was different at some point but didn't remember the details.
No, but I intentionally used a JOIN instead of subquery to avoid massive data transfers to and from the database. Also the feature is behind a setting, so it can simply be disabled. The filter mutator should have negligible impact with the feature disabled. I was not planning any further performance testing. Only if my client needs it. If you prefer we can start by running a fork and report back with the findings later. But since it's behind a setting I think we could benefit from letting more people test it "for us". |
@imorland what is your opinion on this? |
Since the private-visibility query is additive, there would be another way to achieve this that is guaranteed by design to have no impact. Instead of adding another condition to the query to cancel out the first, I could build the query in a way so that the code in the visibility scope disables itself with the action in the filter mutator, effectively adding no SQL for private discussions at all to the final query. I did something similar in my Collapsible Posts extension and I think I should be able to re-use that strategy (https://github.com/clarkwinkelmann/flarum-ext-collapsible-posts/blob/1458451c89844d059139389d0cb433c10b9c7cf7/src/Visibility/PostScope.php#L17 and https://github.com/clarkwinkelmann/flarum-ext-collapsible-posts/blob/1458451c89844d059139389d0cb433c10b9c7cf7/src/Controller/ListCollapsedPosts.php#L107) My client has tested the current version of the PR on their server with ~50k discussions (I think that's the total of both public and private) and has not noticed any impact so far. |
@clarkwinkelmann i would be okay with this. Can you merge and tag it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay here. Yep, I'm totally fine with this, thanks @clarkwinkelmann
Changes proposed in this pull request:
Allow hiding private discussions from the "All discussions" page. The private discussions remain visible in the "Private discussions" page and in the discussion list of a user profile.
This PR was sponsored by a client.
Confirmed
composer test
).