Skip to content
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

Auto-delete thread if all comments in it are deleted #592

Closed
cellio opened this issue Aug 2, 2021 · 3 comments
Closed

Auto-delete thread if all comments in it are deleted #592

cellio opened this issue Aug 2, 2021 · 3 comments
Assignees
Labels
area: ruby Changes to server-side code complexity: easy Issues that should take limited effort to resolve/fix/build. priority: medium type: change request New feature or request

Comments

@cellio
Copy link
Member

cellio commented Aug 2, 2021

Prompted by https://meta.codidact.com/posts/283054 and Mith's comment there:

When all comments in a thread are deleted, please also automatically delete the thread. People who can see deleted comments can also see deleted threads, so this doesn't make anything less accessible, and it allows users to clean up comment threads themselves without requiring mod intervention. This can happen if somebody asks a question in a comment and then realizes the answer (and so deletes the comment), or if two people have resolved a discussion and both cleaned up their sides, or if all comments have been deleted through flags.

I think we could do this by modifying the "delete comment" code to, after deletion, check if surviving comments = 0 and if so delete thread too.

@cellio cellio added area: ruby Changes to server-side code complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: medium type: change request New feature or request labels Aug 2, 2021
@b-Istiak-s
Copy link
Contributor

But, there's a problem. Everyone had requested that there should be a general comments thread by default which contains 0 comments by default. If we delete a thread if that is empty than, General comments will disappear(since, there's no general comments by default now. So, you can ignore the message also)

@cellio
Copy link
Member Author

cellio commented Aug 2, 2021

We don't currently auto-create a "general comments" thread. Threads are started by new comments. If there's a "general" thread that gets deleted by having all its comments deleted, then someone can start a new "general" thread with a new comment. We don't check for uniqueness in thread names; in fact, you could have duplicate names in live threads now.

@ArtOfCode- ArtOfCode- added complexity: easy Issues that should take limited effort to resolve/fix/build. and removed complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. labels Aug 8, 2021
@ArtOfCode- ArtOfCode- self-assigned this Aug 8, 2021
@cellio
Copy link
Member Author

cellio commented Aug 8, 2021

One problem: the thread does get auto-deleted now (good!), but as a moderator I can't see the deleted thread under the post like I should be able to. Haven't tested yet whether this is a problem with the auto-delete case specifically or a broader problem with deleted threads (need to find or make another).

Edit: oops, never mind -- I forgot that I have to click show more" to see those. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ruby Changes to server-side code complexity: easy Issues that should take limited effort to resolve/fix/build. priority: medium type: change request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants