Skip to content

Bug: [lexical-y] The write self-check reports a shadow root's line where the reader shows inline content in a paragraph of its own #9656

Open

Description

@zurfyx

Lexical version: main at 4c04461 (@lexical/y 0.53.0, not released yet), with #9654.

Steps To Reproduce

  1. A shadow-root quote holds a paragraph, and next to it inline content that another writer (a plain Yjs client) put there, not in a paragraph: here text inside a link run that also covers the paragraph.
  2. Every reader shows that inline content in a paragraph of its own ($inShadowRoot), which is not stored.
  3. A local write touches the quote's line without rewriting it (a delete of the quote before it).

With the development self-check on (@lexical/y's test harness enables it), the write reports the quote's line: self-check: line N: text " RAW" != "". The editor's content (two blocks: the shown paragraph and the stored one) is compared with the stored inline content (text, then the stored paragraph).

Link to code example: packages/lexical-y/src/__tests__/unit/regressions/Review9654ReadSafety.test.ts in #9654 (the mixed-before and mixed-after cells, pinned as this report).

The current behavior

The self-check reports a mismatch for a line whose shown content includes a paragraph a shadow root shows around unstored inline content. What clients show and what the write stores are right (the same cells check both).

The expected behavior

The self-check compares such a paragraph's inline content with the stored inline content, as the reader shows it, and reports nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions