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

Implement pasteHandler with plain text fallback #646

Conversation

mkevins
Copy link
Contributor

@mkevins mkevins commented Feb 22, 2019

Description:

Moves forward #624

This PR aims to guard against errors in production during a paste event on mobile. As there are potentially many unexplored code paths (not yet covered by tests), the goal here is to call the original pasteHandler in a try/catch block, and fallback to plain text if an error is encountered.

Note that even in the plain text case, the pasteHandler may still call into some of the complex web code.

Dependencies:

Gutenberg PR: WordPress/gutenberg#14044

Testing:

In order to test, we have to establish a state where a known error exists. A good source to trigger the error is here: #617 (review), but we need to rewind (or revert) the fixes introduced in #630.

  1. Roll back to pre Fix for node.rel crash #630 (git checkout 1fead08b5 in gutenberg-mobile and git submodule update)
  2. cd gutenberg and cherry pick commit
  3. Run demo (may need yarn clean:install first to clear cached dependencies)
  4. Follow instructions here: Adds support for pasting in iOS. #617 (review) copying text surrounding 'Gravity Forms'
  5. Paste into a new paragraph block

Text should paste as plain text (losing the link and styles). It should not error out to the red screen.

koke added a commit that referenced this pull request Feb 22, 2019
@koke
Copy link
Member

koke commented Feb 22, 2019

Updated PR in #650

@koke koke closed this Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants