32

My knowledge was that I cannot delete a question if it has an answer, because members of the community have invested their effort in answering it. Also, the question can still be of value to future visitors to the site with the same/related problems, as mentioned here - https://meta.stackoverflow.com/a/339173/446519

I answered a question yesterday, mainly describing why the problem is occurring and mentioning an alternative. The answer had an upvote, possibly from the OP themselves. The OP asked me in the comment if there is a workaround. I replied, there might be a solution that I'm not aware of. I also told them that I'll try to update the answer and notify them if I can find any helpful information.

Today after finding a better solution, I was trying to update my answer to include the solution. But, to my surprise, in the middle of my editing, the question got deleted. I can still see the post marked with:

This post is hidden. It was deleted 8 hours ago by the post author.

I am just curious. Is this a bug, or can it be done in some way that I'm not aware of?

I did edit the answer once more after the upvote, before adding the solution today.

6
  • 12
    A possible scenario: They upvoted it, then the answer was edited so they could remove their upvote and delete the question (since it no longer had an answer with a positive score). Commented Feb 20, 2021 at 17:23
  • I don't see the upvote on the answer anymore. My Reputaion tab showing unupvote for the question. The link - stackoverflow.com/questions/66268562/…
    – atiyar
    Commented Feb 20, 2021 at 17:23
  • 2
    Yeah, I'd guess that the OP un-upvoted so they could delete the question Commented Feb 20, 2021 at 17:26
  • 2
    @JeanneDark Yes I did edited question once more, to better explain the cause, before adding the solution today.
    – atiyar
    Commented Feb 20, 2021 at 17:27
  • 2
    Added an edit just to clarify the situation better. But I think its clear to me now that its not a bug, and how this can happen. Thanks to everyone.
    – atiyar
    Commented Feb 20, 2021 at 18:36
  • Wait. I tried to delete a question that had an answer, and a message appeared that said that I couldn't. Bug? Commented Feb 21, 2021 at 22:49

2 Answers 2

24

A possible scenario based on how voting (1) and deleting (2) works:

  1. Your answer is upvoted (1 upvote in total)
  2. Your answer is edited (unlocks votes)
  3. Your answer is unupvoted (0 upvotes in total)
  4. The question is deleted by the OP (it has no longer an upvoted answer)

That's how it's technically possible and it also fits in with your description of the situation. Who actually upvoted/unupvoted your answer we cannot know though (only some SE employees can find out).


(1) Voting

In general, once you have voted, you cannot change your vote. There are two exceptions.

  • Exception one: you may change your vote within a five minute window from the time of the first vote you cast on that post.
  • Exception two: you may remove your vote after every time the post is edited (excluding grace period edits). If you cast a new vote after removing a vote under this exception, that new vote will have a new 5-minute window and will work exactly as above.

Source: Answer to What are the limits on how I can cast, change, and retract votes?

(2) Deleting

You can't delete your own question if it:

  • has an answer with upvotes (even if that answer has a net zero or negative score)

Source: Answer to How does deleting work? What can cause a post to be deleted, and what does that actually mean? What are the criteria for deletion?


Further reading (two answers by moderators):

2
  • 9
    Darn, I forgot that any upvotes mean the question can't be deleted by the OP. I somehow remembered it as being a 0 score (or negative).
    – cigien
    Commented Feb 20, 2021 at 18:28
  • 1
    But this leads to the followup question: Is this really what we want? Me too, I find this situation very unsatisfying. You start investing time into a question and it just gets deleted midway trough, maybe before there's even the possibility for somebody else to upvote the answer.
    – PMF
    Commented Feb 23, 2021 at 13:02
10

Based on your description of the situation, there doesn't appear to be any bug here. The OP can delete the question so long as there are no upvoted answers to the question. Technically, there can't be accepted answers as well, but the OP can always just unaccept the answer prior to deletion, so this restriction doesn't matter.

You answered a question, and got an upvote. At this point, the question can't be deleted by the OP. However, if the upvote was removed, the score goes down to 0, and without upvotes on the answer the question can be deleted.

Upvotes can't be removed (on either a question or an answer) after 5 minutes of upvoting unless it's edited. You mention that you edited the answer after receiving the upvote which means the upvoter (possibly the OP) removed the upvote. The revision history also doesn't show any upvotes on your answer, and the votes currently stand at +0/-0, which allows the question to be deleted by the OP.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .