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

Deleting all comments in a thread deletes the thread itself #795

Open
MoshiKoi opened this issue May 12, 2022 · 4 comments
Open

Deleting all comments in a thread deletes the thread itself #795

MoshiKoi opened this issue May 12, 2022 · 4 comments
Labels
area: ruby Changes to server-side code complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: medium type: bug Something isn't working

Comments

@MoshiKoi
Copy link
Member

Meta post: https://software.codidact.com/posts/286433

  1. Add a comment through a reaction
  2. Delete the comment in the thread
  3. (The thread itself is now deleted)
  4. Retract the reaction
  5. Attempt to add back the reaction with a comment
  6. The comment is added to the thread, but the thread is still deleted and not visible

Interestingly, normally viewing the thread will give you the message "You cannot reply to this thread because it has been deleted." However, this procedure actually gets around that restriction even for non-mod/non-curate users, though they would not be able to view the thread anyway.

Suggested solution: Distinguish between all comments deleted and thread deleted. It should still be possible to automatically hide threads that have zero visible comments. Threads would automatically become visible again once a new comment is added and pushes the visible comment count up to one.

@cellio
Copy link
Member

cellio commented May 12, 2022

Hiding rather than deleting an empty thread would work, but do we want to resurrect an old thread with new reactions? The reaction code could check for an existing undeleted thread, as opposed to just an existing thread, and create a new one if needed. (I thought it already did that, but I guess not.)

@cellio cellio added area: ruby Changes to server-side code type: bug Something isn't working priority: medium complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. labels May 12, 2022
@celtschk
Copy link

Actually creating a new thread was what I had intuitively expected when doing the reaction again. On the other hand, would an ordinary user even see the difference between a resurrected and a new thread?

@MoshiKoi
Copy link
Member Author

Hiding rather than deleting an empty thread would work, but do we want to resurrect an old thread with new reactions? The reaction code could check for an existing undeleted thread, as opposed to just an existing thread, and create a new one if needed. (I thought it already did that, but I guess not.)

Problem: What happens if the old thread is undeleted?

@cellio
Copy link
Member

cellio commented May 12, 2022

That's a good point. I can think of two fixes, both in the reaction-handling code:

  1. Check for an existing thread (as it does now) and then, if it's deleted, undelete it. Problem: this can resurrect something that a moderator decided to delete (as the easiest way to clean up a mess), which could be a problem. We can mitigate that in various ways, or we can...
  2. Check for an existing thread (as now), and if it's deleted, break the association between that thread and the reaction and then create a new reaction thread as if that other one didn't exist. If the other one gets undeleted, it's just history, not the active thread. Breaking the association could include renaming it to make that clear. (I don't know how the code works; maybe renaming it is enough to break the association?)

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: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: medium type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants