Bug: lexical-yjs create nodes using constructor without args
- Dominant language
- TypeScript
- Stars
- 23.9k
- Forks
- 2.2k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 61
Description
The `createLexicalNodeFromCollabNode` function creates a node using the constructor without arguments, and then synchronizes the properties using `collabNode`.
This can be fatal if the constructor requires arguments. It is dangerous to call a constructor in a way that was not designed by the user.
Lexical version: 0.12.0
## Steps To Reproduce
1. Use a node whose constructor throws an error if an argument does not exist with collab mode.
## The current behavior
Error is thrown.
## The expected behavior
No error is thrown.
Contributor guide
Research direction
Start at the createLexicalNodeFromCollabNode function and reproduce the issue with a node constructor that throws when its argument is missing. Trace how the collabNode properties are synchronized and verify that collab mode can create the node without throwing when the constructor requires arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100