(Go: >> BACK << -|- >> HOME <<)

Page MenuHomePhabricator

No timeout recovery when switching between visual and source editor
Open, Needs TriagePublicBUG REPORT

Assigned To
Authored By
SUM1
Apr 24 2022, 3:41 PM
Referenced Files
F35245115: image.png
Jun 15 2022, 11:16 PM
F35245117: T306763a.webm
Jun 15 2022, 11:16 PM
F35245105: image.png
Jun 15 2022, 11:16 PM
F35245101: image.png
Jun 15 2022, 11:16 PM
F35065862: image.png
Apr 24 2022, 3:41 PM
F35065861: image.png
Apr 24 2022, 3:41 PM

Description

Steps to reproduce:

  • Go on any article on a Wikimedia project.
  • Click "Edit" or "Edit source".
  • Enter an internet condition that causes timeouts.
  • Switch to the other editor (source or visual).

What happens?:
The following popup shows.

image.png (141×503 px, 15 KB)

Then, if you click "Cancel", VisualEditor fails to recover (as has been implemented in other scenarios such as clicking "Publish changes"). Instead, it gets hung on the loading bar,
image.png (81×505 px, 3 KB)

and all your changes made so far are now inaccessible.

What should have happened instead?:
It should recover and allow the user to continue editing in the mode they were previously in.

Unrelated side note: in the other scenario of clicking "Publish changes" in a timeout condition, it would be preferable if the button didn't arbitrarily grey out after the timeout, forcing the user to exit out of the box and re-open it.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
Windows 7
Chrome 99.0.4844.51

Event Timeline

Change 786331 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] ArticleTarget: Ensure dataPromise rejects when switching fails

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

Change 786331 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ArticleTarget: Ensure dataPromise rejects when switching fails

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

matmarex added subscribers: Esanders, matmarex.

@Esanders I'm not sure if that entirely resolves the problem?

I also noticed while testing that pressing Escape while the progress bar dialog is visible now closes the editor completely, instead of only closing that dialog. (may be caused by https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/786328)

Change 805789 had a related patch set uploaded (by Esanders; author: Esanders):

[VisualEditor/VisualEditor@master] Always prevent default on <esc> while the ProgressDialog is open

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

The above patch ensures the ProcessDialog always captures <esc>, however I think the problem here is that DesktopArticleTarget is listening to escape at the HTMLDocument level. If the user presses escape while in the site search bar, it should not close the editor. We should move that binding to the surface like other commands.

Change 805810 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] Use surface's cancel command to close the editor

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

Change 805810 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Use surface's cancel command to close the editor

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

I also noticed while testing that pressing Escape while the progress bar dialog is visible now closes the editor completely, instead of only closing that dialog. (may be caused by https://gerrit.wikimedia.org/r/c/VisualEditor/VisualEditor/+/786328)

The above patch ensures the ProcessDialog always captures <esc>, however I think the problem here is that DesktopArticleTarget is listening to escape at the HTMLDocument level. If the user presses escape while in the site search bar, it should not close the editor. We should move that binding to the surface like other commands.

(Filed as T310695, and fixed)

Change 805789 abandoned by Bartosz Dziewoński:

[VisualEditor/VisualEditor@master] Always prevent default on <esc> while the ProgressDialog is open

Reason:

No longer needed

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

Outstanding issues:

  • Something is messed up with the error message when switching with changes from VE:
    image.png (1×1 px, 154 KB)
    (we should probably just get rid of the "Error loading data from server" prefix)

    For comparison, when switching without changes, the error message isn't messed up: (and also has a "Try again" button)
    image.png (1×1 px, 88 KB)
  • When switching with changes from 2017WTE, the dialog isn't messed up and has a "Try again" button, but the button will actually switch while discarding your changes!
  • When switching from old WTE, the VE loading bar will appear and get stuck, with no error message:
    image.png (1×1 px, 81 KB)
    (you can recover from this by pressing Escape)

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

[mediawiki/extensions/VisualEditor@master] Remove redundant error message used sometimes when switching

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

Change 805919 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Remove redundant error message used sometimes when switching

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