Page MenuHomePhabricator

Failure to restore saved edit breaks selection
Open, Needs TriagePublic

Description

I'm reloading a document and getting this error in the console:

ve.init.mw.ArticleTarget.js?7989b:471 Error: Failed to restore auto-saved session: Error: Invalid transaction, annotation to be cleared is not set
    at VeDmSurface.ve.dm.Surface.restoreChanges (ve.dm.Surface.js?a16d2:1257)
    at VeInitMwDesktopArticleTarget.ve.init.mw.ArticleTarget.surfaceReady (ve.init.mw.ArticleTarget.js?7989b:466)
    at VeInitMwDesktopArticleTarget.ve.init.mw.DesktopArticleTarget.surfaceReady (ve.init.mw.DesktopArticleTarget.js?6fd15:792)

...probably as a side-effect of me testing stuff that does generate bad transactions on this page, so fair enough.

However, this results in a document which can't be edited initially. Clicking in it anywhere immediately resets the selection to the beginning of the document. Once some input has been made at the start of the document, selection works again. Still, this is bad behavior, and a failed restore should probably be more graceful about it.