Page MenuHomePhabricator

VisualEditor crashes with "Annotation with hash not found in store" when saving after pasting certain rich text content
Open, LowPublic

Description

  1. Open https://en.wikipedia.org/wiki/Special:MyPage/sandbox?veaction=edit
  2. Open data:text/html,<!DOCTYPE html><html><body><div><div><a>text</a></div><div><span aria-label="text">text<span class="text"></span>text</span></div></div></body></html>.
  3. Hit ⌘-A and then ⌘-C (or another platform equivalent shortcut for selecting all content and copying it to the clipboard).
  4. Paste the content into the VisualEditor window.
  5. Click "Publish changes…"

Expected: save dialog opens. Actual: nothing happens, error in JavaScript console.

The reduced test case is bigger than I would like, but it's extremely unstable when I try to prune it and there seem to be multiple attributes required to trigger this.

Stacktrace:

Uncaught Error: Annotation with hash h7b4c733d2236abd9 not found in store
    at new VeDmAnnotationSet (load.php?debug=false&lang=en&modules=ext.CodeMirror.lib|ext.visualEditor.core&skin=vector&version=0h6wgn9:297)
    at VeDmConverter.ve.dm.Converter.getDomSubtreeFromData (load.php?debug=false&lang=en&modules=ext.CodeMirror.lib|ext.visualEditor.core&skin=vector&version=0h6wgn9:513)
    at VeDmConverter.ve.dm.Converter.getDomSubtreeFromModel (load.php?debug=false&lang=en&modules=ext.CodeMirror.lib|ext.visualEditor.core&skin=vector&version=0h6wgn9:508)
    at VeDmConverter.ve.dm.Converter.getDomFromModel (load.php?debug=false&lang=en&modules=ext.CodeMirror.lib|ext.visualEditor.core&skin=vector&version=0h6wgn9:508)
    at VeDmSurface.ve.dm.Surface.getDom (load.php?debug=false&lang=en&modules=ext.CodeMirror.lib|ext.visualEditor.core&skin=vector&version=0h6wgn9:409)
    at VeUiMWSurface.ve.ui.Surface.getDom (load.php?debug=false&lang=en&modules=ext.CodeMirror.lib|ext.visualEditor.core&skin=vector&version=0h6wgn9:823)
    at VeInitMwDesktopArticleTarget.ve.init.mw.ArticleTarget.createDocToSave (<anonymous>:833:404)
    at VeInitMwDesktopArticleTarget.ve.init.mw.ArticleTarget.getDocToSave (<anonymous>:833:112)
    at VeInitMwDesktopArticleTarget.ve.init.mw.ArticleTarget.showSaveDialog (<anonymous>:846:204)
    at VeInitMwDesktopArticleTarget.ve.init.mw.ArticleTarget.onToolbarSaveButtonClick (<anonymous>:845:768)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 5 2018, 3:36 AM
TheDragonFire renamed this task from VisualEditor crashes with "Annotation with hash not found in store" when pasting certain rich text content to The 2017 wikitext editor crashes with "Annotation with hash not found in store" when pasting certain rich text content.Apr 5 2018, 3:53 AM
TheDragonFire updated the task description. (Show Details)
TheDragonFire updated the task description. (Show Details)Apr 5 2018, 3:56 AM
matmarex added a subscriber: matmarex.

I would expect the root of the issue to be <span class="text"></span>. VisualEditor's data model doesn't really support inline nodes with no content (or, as we call them, "zero-length annotations"), and we use some workarounds to allow them to exist. Perhaps there is some specific case we are not handling here. Paste sanitization causing problems maybe?

Deskana moved this task from To Triage to Freezer on the VisualEditor board.Apr 12 2018, 1:12 PM
Deskana triaged this task as Low priority.
TheDragonFire closed this task as Resolved.Oct 7 2018, 8:55 AM

This no longer seems to occur...

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptOct 7 2018, 8:55 AM
matmarex reopened this task as Open.Oct 10 2018, 6:50 PM

I can still reproduce in visual mode.

matmarex renamed this task from The 2017 wikitext editor crashes with "Annotation with hash not found in store" when pasting certain rich text content to VisualEditor crashes with "Annotation with hash not found in store" when saving after pasting certain rich text content.Oct 10 2018, 6:52 PM
matmarex updated the task description. (Show Details)