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.) {F5151718}
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 run 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...?