yjs/y-quill

Nonconvergence when selecting Header on demo site

burke opened this issue · 2 comments

burke commented

Checklist

Describe the bug

Selecting "Heading 1" causes divergent states across peers

To Reproduce
Steps to reproduce the behavior:

  1. Open https://demos.yjs.dev/quill/quill.html in two windows
  2. Clear document contents
  3. Refresh both windows
  4. Click "Normal" and select "Heading 1" in one window
  5. Type "heading 1" (newline) (newline) "normal"
  6. Observe different states across windows
  7. Refresh both windows
  8. Observe that both documents are now in a third state, different from either state from step 6.

Expected behavior

No divergence

Screenshots

Screen Shot 2020-10-22 at 15 09 08

Screen Shot 2020-10-22 at 15 09 16

Environment Information

  • macOS Catalina 10.15.6
  • Brave Version 1.15.75 Chromium: 86.0.4240.99 (Official Build) (x86_64)

Hi @burke , Quill sometimes inserts additional formatting changes without firing the appropriate events. It is hard to detect that this is happening.

Quill has some really weird behavior if the last paragraph receives formatting attributes (e.g. the last paragraph is transformed to a heading, then to a centered text). One solution would be to prevent the user from creating empty documents. Before the user modifies the last paragraph, we could automatically append an additional paragraph. However, this is far from optimal..

The best solution for this would be to always double-check the quill document before applying formatting changes.

To be honest, it could be a while before I have time to look into this.

This was an issue with the text-formatting implementation in Yjs. It should be fixed now.

I followed the steps to reproduce the issue and now end up in the same state on all sites.

You will notice that one window might have a newline more than another window. But that is the expected behavior for now. The text-attributes and block-formats don't diverge anymore.

Please let me know if you can still reproduce the issue.