[go: up one dir, main page]

Page MenuHomePhabricator

Editnotices about pending changes are not shown in VisualEditor
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce:

What happens?:
The classic wikitext editor shows an editnotice warning that Your changes will be displayed to readers once an authorized user accepts them. The stable version was checked on ... There are x pending changes awaiting review. Notice: Some of the pending changes affect the area of the page you are editing. (revreview-editnotice, revreview-pending-basic, review-edit-diff). VE and NWE do not show any editnotice.

What should have happened instead?:
The editnotice should be shown in VE/NWE in the usual dropdown, like any other editnotice (e.g. the one warning about editing an old version of a page). Otherwise, users might not realise that they are not editing the same version of the page that they had been reading.

Event Timeline

The following system messages are required:

  • revreview-editnotice
  • revreview-pending-basic
  • review-edit-diff

It looks like FlaggedRevs relies on RequestContext::getMain()->getTitle() via globalArticleInstance in various hooks. This is not populated in API requests, so getEditNotices just does nothing in API requests.

As VE fetches edit notices via an API request, this results in no edit requests showing in VE.

I started looking into doing this properly, because making the changes in FlaggedRevs seemed easy enough, but I ran into a few issues. First, it relies on global state for more than I thought, and the obvious fix caused the edit notices to appear twice in the old wikitext editor. Then I also realized that the checkbox in the save dialog is also missing ("Accept this version (includes 1 pending change)"). Maybe it's all fixable, but I don't want to cause more issues, and I also don't want to end up spending several days working on this, so I'll just restore the hack :(

Change 790768 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Restore global context fiddling to fix FlaggedRevs edit notices and checkboxes

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

Change 790768 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Restore global context fiddling to fix FlaggedRevs edit notices and checkboxes

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

I'll go ahead to verify since the scope of the ticket is covered in the passing tests. See below:

The Edit notices are displayed as expected:

Screenshot 2022-05-11 at 20.20.44.png (372×3 px, 116 KB)

Screenshot 2022-05-11 at 20.21.30.png (748×3 px, 208 KB)

Screenshot 2022-05-11 at 20.21.51.png (718×3 px, 240 KB)

However, the checkbox is missing for VE/NWE as @matmarex mentioned in T307852#7919201

Screenshot 2022-05-11 at 20.26.52.png (574×3 px, 137 KB)

VE:

Screenshot 2022-05-11 at 20.27.26.png (782×1 px, 114 KB)

NWE:

Screenshot 2022-05-11 at 20.27.51.png (800×1 px, 119 KB)

However, the checkbox is missing for VE/NWE as @matmarex mentioned in T307852#7919201

It works for me when testing at https://de.wikipedia.beta.wmflabs.org/wiki/Schweizerdeutsch:

image.png (2×3 px, 298 KB)
image.png (2×3 px, 271 KB)

Note that, in order for the checkbox to appear, the page must have some pending changes, and your account must have permission to accept them.


I think you might have actually discovered an unrelated issue with the auto-save mechanism. It turns out that we don't re-load the checkboxes when restoring an auto-saved edit, and we probably should. (I realized that this might be an issue after I switched my language from German to English to replicate your screenshots, and I saw that the checkbox labels were still in German.)

My guess is that you first tried editing the page using an account that didn't have the permissions, and then you switched to a different account once you realized that's a problem, but the edit was restored from auto-save together with the checkboxes for the previous user, which is why the expected checkbox did not appear.

(Another possible scenario is that you tried editing the page before we fixed the bug, then you refreshed the page expecting to see the fixed version, but the edit was restored together with the faulty checkboxes.)

I works for me too. Thanks for pointing that out.
VE:

Screenshot 2022-05-12 at 01.03.01.png (904×1 px, 136 KB)

NWE:

Screenshot 2022-05-12 at 01.36.29.png (648×1 px, 79 KB)

However, the checkbox is missing for VE/NWE as @matmarex mentioned in T307852#7919201

It works for me when testing at https://de.wikipedia.beta.wmflabs.org/wiki/Schweizerdeutsch:

image.png (2×3 px, 298 KB)
image.png (2×3 px, 271 KB)

Note that, in order for the checkbox to appear, the page must have some pending changes, and your account must have permission to accept them.


I think you might have actually discovered an unrelated issue with the auto-save mechanism. It turns out that we don't re-load the checkboxes when restoring an auto-saved edit, and we probably should. (I realized that this might be an issue after I switched my language from German to English to replicate your screenshots, and I saw that the checkbox labels were still in German.)

My guess is that you first tried editing the page using an account that didn't have the permissions, and then you switched to a different account once you realized that's a problem, but the edit was restored from auto-save together with the checkboxes for the previous user, which is why the expected checkbox did not appear.

(Another possible scenario is that you tried editing the page before we fixed the bug, then you refreshed the page expecting to see the fixed version, but the edit was restored together with the faulty checkboxes.)

I think you might have actually discovered an unrelated issue with the auto-save mechanism. It turns out that we don't re-load the checkboxes when restoring an auto-saved edit, and we probably should. (I realized that this might be an issue after I switched my language from German to English to replicate your screenshots, and I saw that the checkbox labels were still in German.)

Another ticket will cover this on reproduction of bug. As far as this ticket is concerned, I think it is ready to be signed off.