"Uncaught Error: Invalid end offset: X" when undoing an HTML paste in new wikitext editor with syntax editing enabled
Closed, ResolvedPublic1 Story Points

Description

I get "Uncaught Error: Invalid end offset: X" when undoing an HTML paste in new wikitext editor with syntax editing enabled.

Steps to reproduce:

  1. Paste any HTML into the new wikitext editor using Ctrl+V. (For example, copy-paste this entire bug report. But anything that pastes as HTML will do.)
  2. Undo the change using Ctrl+Z.

Backtrace:

Uncaught Error: Invalid end offset: 620
    at VeDmDocument.ve.Document.selectNodes (ve.Document.js?e97c8:120)
    at VeUiCodeMirrorAction.ve.ui.CodeMirrorAction.onDocumentTransact (ve.ui.CodeMirrorAction.js?4ecbb:91)
    at VeDmDocument.oo.EventEmitter.emit (oojs.jquery.js?4bc88:829)
    at VeDmDocument.ve.dm.Document.commit (ve.dm.Document.js?9f48f:391)
    at VeDmMwWikitextSurface.ve.dm.Surface.changeInternal (ve.dm.Surface.js?54266:835)
    at VeDmMwWikitextSurface.ve.dm.Surface.undo (ve.dm.Surface.js?54266:938)
    at VeUiHistoryAction.ve.ui.HistoryAction.undo (ve.ui.HistoryAction.js?a1453:46)
    at VeUiMWWikitextSurface.ve.ui.Surface.execute (ve.ui.Surface.js?89c3f:703)
    at VeUiHistoryCommand.ve.ui.Command.execute (ve.ui.Command.js?a583f:40)
    at VeUiMWWikitextSurface.ve.ui.Surface.execute (ve.ui.Surface.js?89c3f:696)
matmarex created this task.Jun 27 2017, 7:35 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJun 27 2017, 7:35 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

WFM. This was likely fixed by the transaction mirroring rewrite I did.

matmarex closed this task as Resolved.Aug 9 2017, 3:33 PM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptAug 9 2017, 3:33 PM
Jdforrester-WMF set the point value for this task to 1.Aug 21 2017, 3:33 PM