-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[lexical-table] [lexical-selection] Try to fix calling split on undefined #6746
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love adding defensive code that ignores input when the types are wrong, it's just hiding some incorrect cast somewhere else if these are anywhere near the actual problem. Maybe a better option would be to add a typeof string invariant to getStyleObjectFromRawCSS if that's a suspect and then you'd at least know that's where the failure is?
The textDecoration case seems awfully unlikely because that looks like a DOM node and those shouldn't have these kinds of surprises
Agreed, but I think for these 2 the changes make sense. |
Second highest error rate leading to editor crashes we are observing is the following error:
"Cannot read properties of undefined (reading "split")..."
Unfortunately, I don't know how to reproduce the error.
Have gone through the whole codebase and everywhere we call 'split' and have narrowed it down to 3 places (insertRawText method + the 2 in this PR), my gut feeling is that it's probably the table cell method, but the other 2 also could do with the defensive if statement.
EDIT: Will start only with the table plugin and CSS parsing edits