Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[Feature] 'Select all user's comments' in admin #2027
Do you want to request a feature or report a bug?
Bug? Incomplete feature perhaps.
By clicking 'select all' in Talk admin for a user's comments, admins would like to easily reject all comments for a particular user (generally spammers, with hundreds of comments).
Bulk approving/rejecting comments (original issue #1027) only selects 10 comments at a time, or however many have been loaded on the admin sidebar. This makes removing a user's comments with anything more than 100 or so is an unnecessarily manual process.
How to reproduce the issue:
In admin, click select all on a users comments (original issue has screenshots).
Version and environment
Perhaps it should operate like gmail, where initially clicking 'select all' selects showing comments, and prompts to further select all comments, like
Looked at what's happening now a bit. It's iterating individual comments and triggering a setStatus on each one then waiting for all of those changes to resolve.
I think perhaps we could make a new mutation like
Turns out changing the status of a comment triggers some side effect operations including:
While I can do the asset cache clear and karma all at once in separate post-update actions based on total changes, reply counts check the pre- and post-change visibility state of the affected comments.
There is no way (in mongo, that I know of) to atomically run a find and update on multiple documents at once (so I can figure out if the change should trigger an increment or decrement on the parent reply count) meaning I still have to iterate one at a time to make sure the parent is updated accurately.
That might take some time with large numbers of comments, so it's probably prudent to run it in chunks and display chunked progress to the user. Perhaps update 50 comments each chunk and write feedback/progress to the UI up top somewhere?