qpixel icon indicating copy to clipboard operation
qpixel copied to clipboard

Deleting all comments in a thread deletes the thread itself

Open MoshiKoi opened this issue 3 years ago • 4 comments

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.

MoshiKoi avatar May 12 '22 09:05 MoshiKoi

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 avatar May 12 '22 13:05 cellio

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?

celtschk avatar May 12 '22 16:05 celtschk

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?

MoshiKoi avatar May 12 '22 16:05 MoshiKoi

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?)

cellio avatar May 12 '22 17:05 cellio