Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.43k stars 1.99k forks source link

Simple Sites - Embedding Broken Twitter links causes errors in editor #73002

Open irfano opened 1 year ago

irfano commented 1 year ago

Quick summary

Broken Twitter links cause a freeze while editing the draft on Chrome. I wrote a draft with an active Twitter link yesterday. Today, the tweet is removed and I can't edit my draft.

Screenshot 2023-02-06 at 15 36 10

Internal case for the broken draft: p4ya8V-4XL-p2 (I'll keep the draft as an example. You can remove the draft after fixing the issue.)

Steps to reproduce

  1. Post a test tweet on Twitter.
  2. Write a post on your site and add your tweet link to the post.
  3. Save the post as a draft. Close the page.
  4. Remove your tweet.
  5. Open your draft to edit on Chrome.
  6. Wait 5-10 seconds.
  7. Notice the freeze.

What you expected to happen

The embedded block with the broken link should be converted to clean text. This is what happens on Safari.

What actually happened

Chrome page freezes after 5-10 seconds.

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

No response

Logs or notes

It freezes on Chrome but works on mobile applications and Safari.

cuemarie commented 1 year ago

๐Ÿ“Œ SCRUBBING : RESULT - Replicated / Could Not Replicate / Uncertain

๐Ÿ“Œ FINDINGS/SCREENSHOTS/VIDEO

  1. On a post, add the Twitter block
  2. Paste a twitter link that does lead to a post, such as https://twitter.com/elonmusk/status/1621988107603116033 (from the example above. This leads to a twitter message that says Hmm...this page doesnโ€™t exist. Try searching for something else.
  3. Once the tweet embeds as a URL, click Undo

The editor errors out. Error:

Error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at al (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:82569)
    at Jt (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:52948)
    at K (https://s0.wp.com/_static/??-eJytks2OwjAMhF+I1Fshfi4rniVNrNYliUPiFHh7whVxWXmPlq1P45mBezaOk2ASyKHNlCrMrY8TlrlvCsI2Hob9MMLUKHigaupiQ+C7wVuzASh5fAyR0rDWHfwVd8WnY49VicmFuJA8za1hQyXMccxctZQuabOCxmbSflfQt4cp3ISSVpa3YpWIRWIw/ZqE1MHVhYu8G6DkTIHd9YsYSi60d7/WCp6qwIbJc4HIsbM1Lv5DP2J3cPuw8BJ/x+PpvD//nI6H9QXCk08l:15:27218)
    at https://s0.wp.com/_static/??-eJytks2OwjAMhF+I1Fshfi4rniVNrNYliUPiFHh7whVxWXmPlq1P45mBezaOk2ASyKHNlCrMrY8TlrlvCsI2Hob9MMLUKHigaupiQ+C7wVuzASh5fAyR0rDWHfwVd8WnY49VicmFuJA8za1hQyXMccxctZQuabOCxmbSflfQt4cp3ISSVpa3YpWIRWIw/ZqE1MHVhYu8G6DkTIHd9YsYSi60d7/WCp6qwIbJc4HIsbM1Lv5DP2J3cPuw8BJ/x+PpvD//nI6H9QXCk08l:15:27707
    at Dr (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:72972)
    at $r (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:75013)
    at jr (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:74853)
    at $r (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:75610)
    at jr (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:74853)
    at $r (https://s0.wp.com/wp-content/plugins/gutenberg-core/v15.3.1/build/vendors/react-dom.min.js?m=1678380765h&ver=18&a8cminify=true:1:75610)

Simple Example

https://user-images.githubusercontent.com/27249804/226736383-21a40391-ca0f-4700-9861-6193a79d854e.mp4


AT & SH Examples

On AT and Self-Hosted sites, the embed block warns that no content can be embedded, and offers to convert the embed to a simple link.

Markup on 2023-03-21 at 13:47:37

๐Ÿ“Œ ACTIONS