This is related to {T49779}, which reached mw.org a little while ago.
Steps to reproduce:
1) Open a page in VisualEditor.
2) Click the new icon in the toolbar to switch to the wikitext editor.
3) Click the new icon in the toolbar to switch back to the visual editor.
4) (Make some change so that you can save.)
5) Save the page. (It works.)
6) Click the history tab.
Result: You get an error message that says your change hasn't been saved.
In Safari 9, the error says: "From “www.mediawiki.org”: "Are you sure you want to leave this page? Leaving this page may cause you to lose any changes you have made. If you are logged in, you can disable this warning in the "Editing" section of your preferences". In Firefox 41, the error says: "This page is asking you to confirm that you want to leave - data you have entered may not be saved."
Expected behavior: No error message, because the page was already saved.