Revision history for flagged post isn't comparing the correct revisions

A user’s post was flagged as inappropriate and hidden. They’ve edited their post to make it acceptable and it’s now not hidden. The edit history however shows the two revisions as the new content.

Does this sound like the intended behaviour? Is it because we don’t want the previous objectionable content to be visible any more? Could instead the old content be saved as a hidden revision instead?

Unless the edits happened in the grace period, which isn’t possible with a flag edit (you can’t edit for a certain amount of time), a revision is always created for the edit.

Huh. Well the old content is definitely not there any more. I guess I’ll keep an eye out for it happening and report back if I ever see it happen again.

There is no way that I know of that this can happen. It’s never been reported before, either, to my knowledge.

(unless we have a new bug or regression, somehow)

I am testing this on and I can’t repro at all.

Flagging itself enforces a 10 minute “can’t edit” cooldown so the user cannot edit the post quickly enough to fit within the grace period – and that’s also assuming the post was flagged to threshold immediately after posting!


I have a screenshot of the old content from a mod message:

(It is a bit odd that it’s shown in the post, as it’s only a link, not a quote. I guess the excerpt is baked in?)

While here is the current post, where you can see in the edit history that everything after the first two sentences isn’t present:

I also just tried it myself, and the same thing happened, the edit history was lost, both revisions show the new content (though I only tested with my admin account so it could be different). (Testing again with a regular user, taking time because of the cooldown.)

We’re on 2.4.0.beta10. Happy to test here if you like.

It is weird that in the referenced post, the revision shows but there is no difference between the revisions.

I am actually able to repro this on try! So I’ll reclassify this as bug.

There is a bug here @eviltrout – looks like a mistake in the revision UI to me, notice how I made an edit here adding the bottom sentence, but I am comparing revision 2 to revision 2 instead of revision 1 to revision 2:


This seems to be specific to the editing path for a hidden post @eviltrout. Random edits to existing posts on try do not exhibit this behavior.


I was able to track down the issue, and have merged a fix.

Nice catch finding this bug!