Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Shared Blocks: Fix editing paragraph blocks #7077
Right now editing shared blocks is broken because when we render the Autocomplete component (used in paragraph blocks), we're triggering a "fetch shared blocks" request. This requests is causing the uid of the block attached to the shared block to be regenerated which means the block will rerender (considered as a different block) and the loop continues.
The root cause of the issue is not fixed in this PR, this is a hacky fix will small implications than can land in 3.0 but as a follow-up I'm planning to fix the root issue which is the fact that we have a cycle dependency in our shared blocks state.
This cycle is forcing us to regenerate the block attached to the shared block when we fetch them.
Regarding the failing tests: the fact that we now always fetch shared blocks means that
This isn't an issue introduced in this PR (nor in the previous PR working on the autocompleter, IMO), but it exposes the root problem: that adding block knowledge (awareness of available shared blocks) to our application (even when said blocks are not impacting the post) is treated as an editor change.