Page MenuHomePhabricator

Revert links do not do anything
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce:

  • Click a revert link

What happens?:

Nothing

What should have happened instead?:

The edit should be reverted.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.: v1.0.0-42072d

Event Timeline

Slst2020 moved this task from Backlog to Groomed/Ready on the Toolhub board.

from the discussion we had about the "revert" functionality @bd808 and @Slst2020, this was the expected behavior? (especially when reverting the last revision?)

The revert behavior that we intended to implement is that the state of the toolinfo record becomes equal to the state at the revision being reverted to. If the revision history of a record is A -> B -> C -> D and a revert action is called for on revision B, the new history of the record will be A -> B -> C -> D -> E with new revision E being strictly equal to prior revision B. Another way to look at this same behavior is that reverting to revision X involves undoing each and every revision between the current head revision and revision X as an atomic transaction.

from the discussion we had about the "revert" functionality @bd808 and @Slst2020, this was the expected behavior? (especially when reverting the last revision?)

Reverting to the current revision is a no-op and ideally we would not present it as an option in the UI.

I assumed that it was like MediaWiki's rollback (since it is present on current revisions with undo) instead of Twinkle's restore.

The revert behavior that we intended to implement is that the state of the toolinfo record becomes equal to the state at the revision being reverted to.

I would update the label to something like restore this version (taken from the Twinkle) since it is restoring the state of a revision.

Reverting to the current revision is a no-op and ideally we would not present it as an option in the UI.

Yes. I'd say the link also shouldn't be present in recent changes at all.

bd808 changed the task status from Open to In Progress.Dec 8 2022, 9:32 PM
bd808 claimed this task.
bd808 moved this task from Groomed/Ready to In Progress on the Toolhub board.

As far as I can tell the actual feature is working as intended, but there is confusion about what the feature should do. I think we can change a few things to try and reduce this confusion:

  • Change action label from "revert" to "restore this version" as suggested by @JJMC89 in T308936#8439825.
  • Only display the "restore this version" action if the revision has a child (meaning this is not the current revision).
  • Only display the "undo" action if the revision has parent (meaning this is not the first revision).
  • Only display the "hide" action if the revision has a child (meaning this is not the current revision).

These changes will apply to the history view for a toolinfo record, the history view for a list, and the recent changes screen.

Change 866519 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[wikimedia/toolhub@main] ui(patrolling): Reduce confusion with patrolling actions

https://gerrit.wikimedia.org/r/866519

Change 866519 merged by jenkins-bot:

[wikimedia/toolhub@main] ui(patrolling): Reduce confusion with patrolling actions

https://gerrit.wikimedia.org/r/866519

Change 868183 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[operations/deployment-charts@master] toolhub: bump container to 2022-12-14-185830-production

https://gerrit.wikimedia.org/r/868183

Change 868183 merged by jenkins-bot:

[operations/deployment-charts@master] toolhub: bump container to 2022-12-14-185830-production

https://gerrit.wikimedia.org/r/868183