Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undoing pasting the same content with list multiple times throws error #1385

Closed
jodator opened this issue Nov 30, 2018 · 3 comments
Closed
Assignees
Labels
package:list package:undo type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@jodator
Copy link
Contributor

jodator commented Nov 30, 2018

Is this a bug report or feature request? (choose one)

🐞 Bug report

💻 Version of CKEditor

latest master @ Chrome

📋 Steps to reproduce

  1. Select some content that contains a list
  2. Paste it ctrl + v
  3. Select all content ctrl + a and paste the content again ctrl + v
  4. Place caret somewhere in the content and paste again ctrl + v
  5. Undo
  6. Undo

✅ Expected result

The undo is applied.

❎ Actual result

Error in the console.

📃 Other details that might be useful

peek 2018-11-30 10-51

Stack trace:

ckeditorerror.js:46 Uncaught CKEditorError: move-operation-nodes-do-not-exist: The nodes which should be moved do not exist. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-move-operation-nodes-do-not-exist


    at MoveOperation._validate (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:53117:10)
    at Model.on (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:50565:14)
    at Model.fire (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:109249:29)
    at Model.(anonymous function) [as applyOperation] (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:111194:16)
    at UndoCommand._undo (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:104349:11)
    at Object.editor.model.enqueueChange [as callback] (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:104636:9)
    at Model._runPendingChanges (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:51185:58)
    at Model.enqueueChange (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:50687:9)
    at UndoCommand.execute (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:104635:21)
    at UndoCommand.on (https://a2ee7d01.ngrok.io/ckeditor5/build/docs/ckeditor5/latest/snippets/features/ui-language/snippet.js:111190:32)
@jodator jodator changed the title Undoing pasting the same content multiple times throws error Undoing pasting the same content with list multiple times throws error Nov 30, 2018
@jodator jodator added type:bug This issue reports a buggy (incorrect) behavior. package:list package:undo labels Nov 30, 2018
@Reinmar Reinmar added this to the iteration 22 milestone Nov 30, 2018
@scofalik scofalik self-assigned this Feb 13, 2019
@scofalik
Copy link
Contributor

scofalik commented Feb 13, 2019

I confirm the issue, it is still reproducible.

The steps can be streamlined:

  1. Prepare empty sample.
  2. Copy a list item (can be from the editor).
  3. Paste the list item.
  4. Paste the list item again inside the first one.
  5. Undo, undo.

The same can be reproduced with headings, so it is not strictly related to lists. Probably some OT error. I am on it.

@scofalik
Copy link
Contributor

I fixed the bug but when you redo, redo after the last step it still crashes, so I will take a look at that. Hopefully, I will find a solution in a reasonable time. If not, I will create a followup issue.

@Reinmar
Copy link
Member

Reinmar commented Feb 18, 2019

Does it crash due to ckeditor/ckeditor5-engine#1678 (comment)? Or maybe my TC will allow you to better understand the redo thing.

Reinmar added a commit to ckeditor/ckeditor5-engine that referenced this issue Feb 18, 2019
Fix: Undo and redo no longer crashes in scenarios featuring pasting content into earlier pasted content. Closes [ckeditor/ckeditor5#1385](ckeditor/ckeditor5#1385).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:list package:undo type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants