Skip to content
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][auto-link] Fix auto link crash editor #6433

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

MaxPlav
Copy link
Contributor

@MaxPlav MaxPlav commented Jul 19, 2024

Fixed bug introduced in #6146. Improving the way a potential top-level domain is parsed for email autolinks. Adding more e2e tests, apparently the email auto-link use case wasn't covered by tests.

Closes #6430

Before

Screen.Recording.2024-07-19.at.18.32.12.mov

After

Screen.Recording.2024-07-19.at.18.32.44.mov

Copy link

vercel bot commented Jul 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2024 11:35pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2024 11:35pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 19, 2024
Copy link

size-limit report 📦

Path Size
lexical - cjs 28.76 KB (0%)
lexical - esm 28.61 KB (0%)
@lexical/rich-text - cjs 37.2 KB (0%)
@lexical/rich-text - esm 28.21 KB (0%)
@lexical/plain-text - cjs 35.85 KB (0%)
@lexical/plain-text - esm 25.5 KB (0%)
@lexical/react - cjs 39.12 KB (0%)
@lexical/react - esm 29.49 KB (0%)

@etrepum
Copy link
Collaborator

etrepum commented Jul 20, 2024

It would probably be a good idea to add a unit test suite for this sort of thing, e2e is a bit overkill to test a regex

@ivailop7
Copy link
Collaborator

I agree with Bob here, these should be perfectly fine to be unit tests, otherwise LGTM.

@MaxPlav
Copy link
Contributor Author

MaxPlav commented Jul 22, 2024

hi @etrepum @ivailop7 thanks for the review, the e2e tests for the Autolink node have existed for quite a while (added probably here #1156) but they didn’t cover all use cases specifically for the Autolink node created for a recognized email pattern. The way the text is transformed to an Autolink node is spread in multiple functions, it’s a bit complicated and not easy to troubleshoot. In this diff (besides the bug fix) I’m just covering all possible positive and negative use cases for the whole autolink creation/update flow transformed from a text email pattern. So I would suggest keeping the e2e tests as it might be not sufficient to cover the functions with unit tests. :) wdyt?

@ivailop7 ivailop7 added the extended-tests Run extended e2e tests on a PR label Jul 22, 2024
@ivailop7 ivailop7 added this pull request to the merge queue Jul 22, 2024
Merged via the queue into facebook:main with commit b88ce57 Jul 22, 2024
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: AutoLink crashes the editor
4 participants