Skip to content

Bug: [lexical-y] A slot a read-only binding keeps showing is removed when an app edits its line in a remote change's read #9813

Open

Description

@zurfyx

@lexical/y: when a local update sets a slot the document cannot store, the binding goes read only and keeps showing it (the editor keeps showing what it cannot store, and leaves later updates as they are, per the docs). If an app's code then edits the slot's host line in the update of a remote change's read (a selectionTransform, or an update queued in the read), the editor reads that line again: the slot is removed and the app's edit is not shown. On the previous main (dfe058a) the slot stayed.

Repro: a paragraph whose text node edits itself during a remote read; set a slot on that paragraph (the binding warns UNSUPPORTED_SLOTS_WARNING and goes read only, the slot shown); a peer edits another line; after sync the slot is gone ($getSlot returns null) and the paragraph shows its stored text.

A cell pinning it as test.fails is in packages/lexical-y/src/__tests__/unit/regressions/DroppedNodeState.test.ts ("a slot kept when the binding went read only stays through a read edit").

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