-
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
[Block Library - Query Loop] Fix race condition for making Post blocks inside uneditable #33037
Conversation
…s inside uneditable
Size Change: -82 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
How do you reproduce the issue, following the steps above, I can't 🤔 even in trunk? |
It's easier to reproduce when clicking the |
…s inside uneditable (#33037)
…s inside uneditable (#33037)
Description and testing instructions from trac ticket:
Fixes trac ticket: https://core.trac.wordpress.org/ticket/53508. When back ported.
Note
It might be easier to reproduce when clicking the grid view of Query Loop patterns when inserting. Since it's a race condition between posts and queryId, you have to select a pattern that shows the Image Placeholder (in Featured Image) that looks like allowing the upload (which it does)
What was the problem
Query Loop
needs a unique id to handle multiple pagination properly and is usingqueryId
attribute. This attribute is set on insertion/creation of the block after the first rendering.This has caused some race conditions with the check we had for making Post blocks not editable inside this block, which used the existence of
queryId
. This PR adds thequeryId
as a dependency to our memoized block contexts so as to always be provided down the chain.