Page MenuHomePhabricator

After saving in VisualEditor some parts are not deactivated (intermittent)
Closed, DeclinedPublic

Description

Sometimes, after saving/exiting VisualEditor, the browser is left in a state as if the editor were still running with unsaved changes. Details below.

  1. Edit any article in VisualEditor. Suppose it is named "Emotion analytics."
  2. Save by pressing Shift-Alt-S twice. The save appears to complete successfully, the VisualEditor toolbar disappears, and we are just viewing the article "Emotion analytics" now.
  3. Strangely, the browser tab still displays the article title as "Editing Emotion analytics", not "Emotion analytics". (See attached screenshot.)
    screenshot while not editing.png (222×723 px, 45 KB)
  4. Attempt to browse to another page, or even to run VisualEditor again by clicking "Edit."
  5. The browser (Chrome) puts up a JavaScript alert box, "Do you want to leave this site? Changes you made may not be saved. [Stay] [Leave]."

Even worse, if this problem happens when you click "Edit" to rerun VisualEditor, and you choose to "Leave" so you enter VisualEditor, SOMETIMES all changes from the previous save are missing!

This is an intermittent problem. It happens for me every ~20 editing sessions. My site runs MediaWiki 1.28.0 and the associated VisualEditor version from ExtensionManager, on Ubuntu 16.04.1 LTS, with all caches in memcached. My browser is the latest Chrome for Linux.

I wonder if VisualEditor is leaving behind a "beforeunload" event handler. But if that's the only issue, that doesn't explain the loss of the previous saved changes, which seems like a cache write failure of some kind...?

Event Timeline

I also see this from time to time. It seems various different parts of the editor teardown don't happen sometimes.

Just now I made a section-level edit on mediawiki.org. After saving and being in read mode for a while I decided to close the tab. Doing so prompted "Changes you made may not be saved.", which doesn't make any sense. (the beforeunload handlers added upon VE activation).

In this particular case, the rest of the page and browser title bar were fine ("Read" tab was selected, and document title did not say "Editing.."). But other times I've seen those issues as well.

Krinkle renamed this task from VisualEditor, after save, intermittently leaves the browser believing that VisualEditor is still running to After saving in VisualEditor some parts are not deactivated (intermittent).Jan 5 2017, 9:00 PM
Krinkle awarded a token.
Jdforrester-WMF changed the task status from Open to Stalled.Feb 28 2017, 8:30 PM
Jdforrester-WMF subscribed.

The title issue is T126077; the onBeforeUnload one is T153346. Can you narrow down this task to just be about the caching behaviour you describe? I've not seen that reported elsewhere.

You sure that T153346 is the same onBeforeUnload issue as this ticket?

  • T153346: an expected onBeforeUnload behavior fails to occur, when switching from VE to WikiEditor
  • This ticket: an unexpected onBeforeUnload behavior occurs, and WikiEditor is not involved

@maiden_taiwan: Has this problem still happened recently?

No, I haven't seen it for a long time. Thanks.

Boldly declining as task author cannot reproduce anymore.