User cannot delete own topics once they have replies

That sounds reasonable and just fancy enough. Sometimes if a topic doesn’t get any replies, it is good to have a way to kill it off. We’ve also had cases where a new category is seeded with topics before being opened up to other members, and some of those topics need to be deleted before the category going live.

@zogstrip can you spec and assign this? It should behave very similarly to post deletion with additional limits (no replies, only created in the last 24 hours, etc).

6 Likes

@nbianca, can you take this?

We need to allow any users to delete their own topic provided it was created in the past 24 hours and there hasn’t been any replies yet.

Deleting your own topic will make a new revision and put a stub in place (only for non-staff members) like we do for any other posts except the text will be different. Something like

(topic withdrawn by author, will be deleted in 24 hours unless flagged)

The stub will be destroyed after 24 hours by the DestroyOldDeletionStubs job.

6 Likes

I think that stub is visible to all users. It is a public notice of intent to withdraw.

Within 24 hours of posting the topic and zero replies seems safe. Note that replies after the intent to withdraw is in place may be implicitly deleted as well but nobody can say they were not warned…

5 Likes

I meant we only put the stub when a non-staff user delete their own topic. This logic should not apply to staff.

5 Likes

This is done in:

https://github.com/discourse/discourse/pull/7267

7 Likes

This doesn’t seem to work. We just had our first user create and delete their own topic. Another user came along and posted a reply before the 24-hour period was up. The time period has now expired and the topic was not removed.

1 Like

Yes, that’s possible, the topic can’t be removed if there are replies to it – then one user would indirectly be deleting another user’s posts.

The idea is that stating public intent to delete in the first and only post of the topic should be enough notice that people shouldn’t reply to the topic. Odd that someone ignored that road sign :stop_sign:

4 Likes

You wrote above that “replies after the intent to withdraw is in place will be implicitly deleted as well”. Now you’re saying the topic can’t be removed if there are replies to it. Which is it supposed to be? Make up your mind, please. Or perhaps the topic should close when withdrawn to prevent any replies.

3 Likes

I guess I did say that… I’m still hesitant to have one user delete another user’s posts, even if accidentally. What do you think @eviltrout?

In the meantime, I’m giving some delete functions a little exercise myself :sweat_smile:

4 Likes

Could we perhaps disable replies until the 24 hour period is up?

3 Likes

Easiest way to do that is to make a topic self delete also close the topic at the time the intent to delete is stated? @nbianca can you take that?

4 Likes

Can users undelete and re-open the topic if they change their mind?

One question and one issue to report:

Q: Does replying to a deleted topic in the form of a new personal message also invoke the topic-replied workflow? I ask because one user created and then deleted a topic within minutes early yesterday, there are no replies on it but I did send a reply as a personal message yesterday. It’s been over 36 hours, but the topic has not been auto-deleted (there are no flags either).

Bug/issue: This topic seems to be included in the summary emails as I can confirm from the “Preview Summary” (with an empty body but showing the title and info about the user who posted it). This is certainly undesired, deleted topics should be filtered out.

1 Like

I don’t think so, @nbianca?

As a moderator, I’m against this change. Even if users do want to delete topics, it still might have helpful information for other users to use, and if they truly do want to delete the topic, a flag will be much easier.

I used to be against it too, but after seeing it in action, it reduces moderator workload and lets users help remove unnecessary topics.

2 Likes

Topics will be closed when a user deletes it. I have also ensured that topic stubs will be destroyed after delete_removed_posts_after hours.

https://github.com/discourse/discourse/pull/7430

8 Likes

I have a particular use case where it actually makes sense for users to delete their own topics, even if they have replies.

My discourse installation allows users to post poems and to receive literary comments, appraisal or suggestions from other users. It happens relatively often that users want to delete the original topic, after having received replies: because they plan to publish a poetry book, or want to take part in a literary contest… or just because they changed their mind and want to keep the poems private.

Since users hold their property rights on their literary creations it does not make sense to prevent them for deleting their own contents, and handling removal requests may be an important overhead for moderators.

Would it be possible to have an allow/disallow option for users deleting any own topic (in addition to the existing option for topics without no replies)?

Thanks!

(Sorry for reopening this topic, let me know whether I should open a new one!)

1 Like

Are you sure Discourse is the right solution for this?

2 Likes