A recent update to the site appears to have removed the "Rollback" option from question and answer revision history pages. I can only currently see 'source', 'edit', and 'link' options.
-
I don't think it has anything to do with the recent update, as just an hour ago I was able to rollback a few edits on posts.– 10 RepJan 12, 2021 at 18:52
-
5@10Rep Notice I said "a recent update", not "the recent update". I'm not referring to any specific update that was intending to fix/change anything in particular, but obviously this was caused by some update to the site; it didn't just magically disappear :-)– TylerHJan 12, 2021 at 18:54
-
Can you see the rollback/Rollback link on the prior revision? I did it on this question earlier today and thought I had to click it on an unexpected revision.– CodeCasterJan 12, 2021 at 19:07
-
3Hmm. The goal was to remove rollback from the most recent revision (since you can't rollback to current) and, if the most recent revision itself is a rollback also remove the link from the revision it rolled back to. Looks like we missed an edge case in there somewhere, though. I think I'd expect to see a "rollback" link on the first revision of this question, for example.– Adam Lear StaffModJan 12, 2021 at 19:11
-
1@CodeCaster No, I could not -- I checked on several posts to make sure it wasn't anything to do with who posted it (e.g. me) or if it was protected, tag-only edits, etc.– TylerHJan 12, 2021 at 19:14
-
2In the question linked by CodeCaster, interestingly I can see a rollback option for 3rd and 1st revisions but not the 2nd. And here stackoverflow.com/posts/2906582/revisions I cannot see the option on any of the revisions cc @AdamLear Looks like there may be a couple extra edge cases (title only edits, tag only edits?) wherein the tags match a prior revision but aren't technically from the same revision.– TylerHJan 12, 2021 at 19:17
-
2@AdamLear I see no rollback buttons on any post or tag wiki/excerpt history I've looked at on SO, MSO, or MSE. I haven't done an exhaustive search, but it's definitely not just in one or two places.– Makyen ModJan 12, 2021 at 19:25
-
6It was me. I did this. A fix is in review. I caused this when fixing this bug and the problem didn't manifest itself in testing because the bad check only failed if the current revision isn't a rollback.– Brian NickelJan 12, 2021 at 19:37
-
@BrianNickel Just tested this and it shows/works for me again.– TylerHJan 12, 2021 at 21:08
-
2It's so nice that those links are all still in lowercase!– NickJan 13, 2021 at 1:46
1 Answer
This is fixed.
It was a bug caused by my incorrect fix to Rollback button appears to the most recent edit revision item if it's a rollback surfaced by a different bug fix. So I'm having a real week.
Some logic was inadvertently flipped in the revisions list so that the current revision would have the "rollback" button. It more or less looked like the following but a little more cryptic:
canRollback = revision != current || (current.IsRollback && !current.IsRollbackTo(revision))
I thought I had brought it back to the original intent when I changed it to:
canRollback = revision != current && (current.IsRollback && !current.IsRollbackTo(revision))
It certainly worked at suppressing the selection on the current revision and the one it was reverting to. Unfortunately, it also included current.IsRollback
and I didn't test it on posts without a rollback as the current revision. :facepalm:
The new code looks much more like:
canRollback = revision != current && !current.IsRollbackTo(revision)