The text...
This question was voluntarily removed by its author.
...is a conditional based on the fact that we can positively identify that the user who wrote the post is in fact the same user who "voted" to delete it. This is because we can compare Posts.OwnerId
and Votes.UserId
and, if they are equal (and > 0, and not null), then we know the author deleted their own post.
When a user is removed, all associations with their content are also removed, so we can no longer be certain that the users are the same. For example, the OwnerId
is set to NULL
or Votes.UserId
is set to NULL
or both. Or, in some cases, one or the other is set the community user (-1), or the row is deleted altogether.
The fallback text when this determination can no longer be made shows that the code assumes moderation was at play - it can no longer be certain that the author is the one who deleted the post because the data simply isn't there or, if it was set to the community user, that moderation of some kind was involved. It's a reasonable assumption when we no longer know anything at all about the original user involved.
We currently don't have a way other than this UserId association to denote that a post was deleted by its author. So perhaps this could be converted into a feature request - for example, a DeletedByAuthor
column that could maintain state even after all the specific UserId
values were removed from the various tables.
Simpler, though, would be to have the fallback text be less assertive about why the post was removed, in lieu of being able to know for sure. It could simply say:
This question was removed from [site name] by the author or by a moderator. Please refer to...
Or even simpler:
This question was removed from [site name]. Please refer to...
If the question was deleted and the user who wrote the post was also deleted, I'm not sure how important it is to be sure whether the author deleted their own post first or if the question was deleted by a moderator (or a pile-on by peers?) before or after the user was removed. Is it to identify the (probably non-existent) case where a moderator deleted a post, the user was removed from the site, and then the moderator resigned and also asked their content to be removed? Because if the post was deleted through moderation (e.g. for spam) before or after the user was removed, it should say this:

Which brings me back to thinking this is a bug and there probably isn't a case where the current fallback is correct. So my suggestion to just make the fallback text simpler seems like the best and most direct solution (since actual known moderation reasons will be kept intact whether the user is removed or not, and the only case we'd need a fallback is when the user self-deleted and no longer exists - but, due to ever-increasing privacy regulations, we probably don't even want to imply that we ever even knew that the author and the deleter were the same person or that they existed at all).
If the post is gone, and the user is gone, how much detail do we really still need about exactly what happened to the post? Isn't "this post was deleted" sufficient?