You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The crash happens when replaceInnerBlocks is called with specific arguments. We encountered this bug while testing the plugin Sensei LMS with WP version 5.7. Unfortunately I wasn't able to be able to reproduce the bug outside of our plugin.
The loop seems to be introduced by the function useNestedSettingsUpdate and in the isShallowEqual check as the newSettings is an object containing the allowedBlocks array which is never equal causing infinite updates.
Interestingly the issue does not seem to happen when updateSelection is set to true.
I tried different Gutenberg versions and it seems that the bug was introduced in version 9.9.0 and it happens also in latest (10.2.1)
In this line update the updateSelection argument to false.
In admin go to Courses -> Add New
In the block with the title 'Course Outline' click 'Create a lesson'
Type a lesson name, add another lesson and update the post.
Remove the 'Course Outline' block and then readd it.
The call to replaceInnerBlocks happens after the lessons are retrieved from a custom endpoint and when we try to set the inner blocks of the 'Course Outline' block.
Expected behaviour
The block to not crash.
Actual behaviour
The block crashes.
WordPress information
WordPress version: 5.7
Gutenberg version: 9.9.0
Are all plugins except Gutenberg deactivated? "No"
Are you using a default theme (e.g. Twenty Twenty-One)? "Yes"
The text was updated successfully, but these errors were encountered:
@gkaragia This sounds like a similar issue to #30274. Do any of your block edit components create a new array for allowedBlocks for every render? I think this could also happen with the template prop if any of your blocks do similar there.
Description
The crash happens when
replaceInnerBlocks
is called with specific arguments. We encountered this bug while testing the pluginSensei LMS
with WP version 5.7. Unfortunately I wasn't able to be able to reproduce the bug outside of our plugin.The loop seems to be introduced by the function
useNestedSettingsUpdate
and in theisShallowEqual
check as the newSettings is an object containing theallowedBlocks
array which is never equal causing infinite updates.Interestingly the issue does not seem to happen when
updateSelection
is set to true.I tried different Gutenberg versions and it seems that the bug was introduced in version 9.9.0 and it happens also in latest (10.2.1)
The issue where we originally discovered this is Automattic/sensei#4065 and we switched the argument of
replaceInnerBlocks
as a workaround in Automattic/sensei#4125Step-by-step reproduction instructions
updateSelection
argument to false.Courses -> Add New
replaceInnerBlocks
happens after the lessons are retrieved from a custom endpoint and when we try to set the inner blocks of the 'Course Outline' block.Expected behaviour
The block to not crash.
Actual behaviour
The block crashes.
WordPress information
The text was updated successfully, but these errors were encountered: