Page MenuHomePhabricator

VisualEditor: Copy & pasting a paragraph when editting a section can cause document to disappear from screen
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:
The contents of the edit box disappear, completely:

image.png (410×1 px, 74 KB)

What should have happened instead?:
The selected section should have been pasted.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
This happens for me on both firefox 92.0.1 and chrome 94.0.4606.81, on Linux Mint 20.1. @ihurbain and @LSobanski both report that they can reproduce this, too.
Note: once it's in this state, you can recover by clicking 'edit source', and then back to 'edit'

Event Timeline

In my case it's Firefox 93 on Ubuntu 20.04.

I've made a much more minimal page for reproduction: https://wikitech.wikimedia.org/wiki/User:Kormat/Orchestrator. The same reproduction steps produce the same result. I'll update the task with this, so that edits to the actual page don't interfere with debugging.

This looks like a bug with section editing as it works fine in full document mode. Desktop section editing is not yet enabled on most wikis.

This is caused by calling rebuildTree in section edit mode:
ve.init.target.surface.model.documentModel.rebuildTree()

In this case it happens because the TransactionProcessor throws an exception.

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

[VisualEditor/VisualEditor@master] Never rebuild above the attachedRoot

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

Change 730586 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Never rebuild above the attachedRoot

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

Change 730609 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

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

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

Change 730609 merged by jenkins-bot:

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

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

I looked into this and the copy n paste works fine but for a glitch. The "paste" somehow affects the existing content. It removed the O in "operations", as well as the "U" in Upgrading. There might be other effects as a result but these 2 are immediately noticeable. I have attached a screenshot for reference.

Screenshot 2021-10-20 at 17.25.35.png (1×2 px, 307 KB)

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

[VisualEditor/VisualEditor@master] Follow-up Ibac94edb: Fix offsets when rebuilding attachedRoot

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

Change 732448 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Follow-up Ibac94edb: Fix offsets when rebuilding attachedRoot

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

Change 732624 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

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

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

Change 732624 merged by jenkins-bot:

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

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

ppelberg claimed this task.