-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[RNMobile] Ensure that blockType
is defined when accessing wrapperProps
#56846
Conversation
Size Change: 0 B Total Size: 1.71 MB ℹ️ View Unchanged
|
Flaky tests detected in 74d5d8e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7178322278
|
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.
LGTM 🎊 ! Thanks @derekblank for addressing the crash 🏅 !
I'd like to share a couple of notes that would be great to tackle but that shouldn't be considered blockers to merge this PR:
- Add an entry to the
react-native-editor
changelog and release notes. - Add an integration test in GBM to cover this case.
The following issue is not a blocker and either a pressing issue we should solve now but wanted to share it as I noticed it when testing in the web version. Seems adding a Paywall block on a Page in the web version also results in an unsupported block. However, the message displayed is different from the one shown in the app. In both cases, I think the message is not accurate:
Web version:
Your site doesn’t include support for the "jetpack/paywall" block. You can leave this block intact or remove it entirely.
I presume this message should state that the block is unsupported in Pages, not the entire site.
App version:
Unsupported
'jetpack/paywall' is not fully-supported
As in the web version, we should mention that it's not supported only in Pages.
Thank you for reviewing @fluiddot -- I've updated the CHANGELOG and opened a companion PR at wordpress-mobile/gutenberg-mobile#6458 with an update to release notes as well. As this change resolves an open crash issue, I've made a note to add an integration test and update the Paywall message issue in follow-up PRs, but agree they are not blockers to merging this PR. If you note that the CI checks have passed for the companion PR have passed and are able to merge that PR to keep the refs up to date, I would be most appreciative. Otherwise, I can pick it up when I return the week after next. 🙇 |
Sounds good, thanks 🙇 !
Sure, I'll check the companion PR and merge it once it's ready. |
What?
Ensure that
blockType
is defined when accessingwrapperProps
in block.native.js.Fixes:
Why?
Prevents a crash in certain circumstances when
blockType
is not defined, like when the block has been unregistered.How?
Matches the web block.js behavior by adding a check to ensure
blockType
is defined when accessingwrapperProps
.Current web behavior:
gutenberg/packages/block-editor/src/components/block-list/block.js
Lines 151 to 157 in 550966a
Current mobile behavior:
gutenberg/packages/block-editor/src/components/block-list/block.native.js
Lines 245 to 249 in 550966a
Proposed mobile change:
gutenberg/packages/block-editor/src/components/block-list/block.native.js
Lines 245 to 252 in 4d2e453
Testing Instructions