Page MenuHomePhabricator

ClipboardHandler preserves existing ImportedDataAnnotation when pasting over previously-pasted content
Open, Needs TriagePublicBUG REPORT

Description

  • Paste content into VisualEditor
  • It's annotated with ImportedDataAnnotation
  • Paste different content on top of some of that existing content
  • It's annotated with ImportedDataAnnotation again, with the prior annotation preserved via getBeforePasteAnnotationSet

Content can't have been imported from more than one source, so this shouldn't happen.

QA

  • Copy content from a source that will trigger paste check (50+ characters, from a site we can't identify as a known editing platform)
  • Paste it into visualeditor when paste check is enabled (ecenable=2)
  • Observe that a paste check is shown
  • Select the entire pasted content and paste the content again
  • Observe that still only one paste check is shown. If multiples appear, this bug is not fixed.

(Pasting over the entire original content is important for testing, as you could wind up with multiple legitimate paste checks if you leave enough of the original, and it's difficult to distinguish this unless you've got debug=true and actually look at the data model.)

Related Objects

Mentioned In
T403745: ve.track module isn't loaded when launching 2017 editor on a page with discussiontools enabled
T403741: Move annotation-removal logic out of AnnotationAction into SurfaceFragment
T400849: Enable "Thanks" from talk pages as an opt-in beta feature
T391521: VE: Deleting sub-ref attached to main content does not orphan other sub-refs in same article
T397145: Move footnote numbering information out of singleton document cache
T401890: Long link labels don't show ellipsis in link context on mobile
T402392: Bring basic reference functionality into VisualEditor standalone
T397518: VisualDiff should use vertical ellipsis consistenly
T302413: Visual diff of templates inside the table shows all descriptions at the bottom, in backwards order
Mentioned Here
rGVEDa5bd08c8bc2a: Move ve.track.js into a separate module
T302413: Visual diff of templates inside the table shows all descriptions at the bottom, in backwards order
T391521: VE: Deleting sub-ref attached to main content does not orphan other sub-refs in same article
T397145: Move footnote numbering information out of singleton document cache
T397518: VisualDiff should use vertical ellipsis consistenly
T400849: Enable "Thanks" from talk pages as an opt-in beta feature
T401890: Long link labels don't show ellipsis in link context on mobile
T402392: Bring basic reference functionality into VisualEditor standalone
T403745: ve.track module isn't loaded when launching 2017 editor on a page with discussiontools enabled
T403741: Move annotation-removal logic out of AnnotationAction into SurfaceFragment

Event Timeline

This has absolutely no visible impact until the paste check is involved, because it'll appear multiple times, once for each annotation.

Change #1180180 had a related patch set uploaded (by DLynch; author: DLynch):

[VisualEditor/VisualEditor@master] ClipboardHandler: respect ImportedDataAnnotation's removes

https://gerrit.wikimedia.org/r/1180180

Change #1184813 had a related patch set uploaded (by Esanders; author: Esanders):

[VisualEditor/VisualEditor@master] Remove existing importedData annotations when inserting new ones

https://gerrit.wikimedia.org/r/1184813

Change #1180180 abandoned by Esanders:

[VisualEditor/VisualEditor@master] ClipboardHandler: respect ImportedDataAnnotation's removes

https://gerrit.wikimedia.org/r/1180180

Change #1184819 had a related patch set uploaded (by DLynch; author: DLynch):

[VisualEditor/VisualEditor@master] SurfaceFragment: respect annotation.removes

https://gerrit.wikimedia.org/r/1184819

Change #1184820 had a related patch set uploaded (by DLynch; author: DLynch):

[VisualEditor/VisualEditor@master] ClipboardHandler: respect ImportedDataAnnotation's removes

https://gerrit.wikimedia.org/r/1184820

Change #1184813 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Respect applyToInsertedContent when pasting

https://gerrit.wikimedia.org/r/1184813

I split various "move removes up into SurfaceFragment" stuff off into T403741.

Change #1185179 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (a5bd08c8b)

https://gerrit.wikimedia.org/r/1185179

Change #1185179 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (a5bd08c8b)

https://gerrit.wikimedia.org/r/1185179

Change #1185982 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@wmf/1.45.0-wmf.17] Update VE core submodule to master (a5bd08c8b)

https://gerrit.wikimedia.org/r/1185982

Change #1185982 abandoned by DLynch:

[mediawiki/extensions/VisualEditor@wmf/1.45.0-wmf.17] Update VE core submodule to master (a5bd08c8b)

Reason:

Would need to do the subrepo backport anyway

https://gerrit.wikimedia.org/r/1185982

Change #1185982 restored by DLynch:

[mediawiki/extensions/VisualEditor@wmf/1.45.0-wmf.17] Update VE core submodule to master (a5bd08c8b)

https://gerrit.wikimedia.org/r/1185982

Change #1185982 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@wmf/1.45.0-wmf.17] Update VE core submodule to master (a5bd08c8b)

https://gerrit.wikimedia.org/r/1185982

Mentioned in SAL (#wikimedia-operations) [2025-09-08T20:04:45Z] <kemayo@deploy1003> Started scap sync-world: Backport for [[gerrit:1185991|Enable DT thanks at mediawikiwiki (T400849)]], [[gerrit:1185982|Update VE core submodule to master (a5bd08c8b) (T302413 T391521 T397145 T401890 T402392 T397518 T402717 T403741 T403745)]]

Mentioned in SAL (#wikimedia-operations) [2025-09-08T20:11:02Z] <kemayo@deploy1003> kemayo, esanders: Backport for [[gerrit:1185991|Enable DT thanks at mediawikiwiki (T400849)]], [[gerrit:1185982|Update VE core submodule to master (a5bd08c8b) (T302413 T391521 T397145 T401890 T402392 T397518 T402717 T403741 T403745)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-09-08T20:17:50Z] <kemayo@deploy1003> Finished scap sync-world: Backport for [[gerrit:1185991|Enable DT thanks at mediawikiwiki (T400849)]], [[gerrit:1185982|Update VE core submodule to master (a5bd08c8b) (T302413 T391521 T397145 T401890 T402392 T397518 T402717 T403741 T403745)]] (duration: 13m 05s)