Last modified: 2013-09-04 02:23:21 UTC
The final case in ve.dm.Document.getMetadataReplace() applies if insert.length > remove.length. But in this case only the 'retain' and 'insert' fields are set on the returned object. In ve.dm.Transaction.pushReplace() we only add the {retain,remove,insert}Metadata fields to the operation if the 'remove' field on the object returned from getMetadataReplace() is not undefined. So these fields won't be set correctly if insert.length > remove.length.
Change 81928 had a related patch set uploaded by Cscott: Collapse metadata on any removal. https://gerrit.wikimedia.org/r/81928
Change 81928 merged by jenkins-bot: Collapse metadata on any removal. https://gerrit.wikimedia.org/r/81928