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

Autoformat should not react to non-transparent batch #2390

Closed
scofalik opened this issue Mar 14, 2018 · 1 comment · Fixed by ckeditor/ckeditor5-autoformat#57
Closed

Autoformat should not react to non-transparent batch #2390

scofalik opened this issue Mar 14, 2018 · 1 comment · Fixed by ckeditor/ckeditor5-autoformat#57
Assignees
Labels
package:autoformat type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@scofalik
Copy link
Contributor

I know, I know.

We just removed this condition, because we thought it is no longer needed. Unfortunately, that was a mistake and we still need to react only to transparent batches. Why?

On model.Document#event:change we check if proper characters have been put together, for example, we check if 1. was typed. If so, we open a new enqueueChange block, and inside it, we insert a list item.

However, the list item is inserted in another batch. What's more, the batch with 1. is sent before and separately to the batch with the list item.

So, in collaboration, a remote client first receives a batch that inserts 1. , the batch is handled (list item is inserted by auto format) and then it receives another batch, which also inserts list item. This causes a bug.

As I also mentioned, it will be enough to react only to transparent batches. Another solution would be to introduce another event (let's call it changesDone ha-ha-ha). That event would be fired after all change blocks are done. I will create a ticket to discuss it.

@scofalik scofalik self-assigned this Mar 14, 2018
@scofalik
Copy link
Contributor Author

szymonkups referenced this issue in ckeditor/ckeditor5-autoformat Mar 16, 2018
Fix: Autoformat should ignore transparent batches. Closes #56.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-autoformat Oct 9, 2019
@mlewand mlewand added this to the iteration 15 milestone Oct 9, 2019
@mlewand mlewand added type:bug This issue reports a buggy (incorrect) behavior. package:autoformat labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:autoformat type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants