Skip to content

Conversation

@Mamaduka
Copy link
Member

What?

Related #71474.

PR applies recent fixes from the getEntityRecord selector to the getRevision. Both selectors share 99% of the logic and that unfortunately includes bugs.

Why?

When a component requests a full entity record, it expects to receive undefined or the whole record. Returning partial data can lead to unexpected failures as described in the issue.

Testing Instructions

// Fetch subset fields.
wp.data.select( 'core' ).getRevision( 'postType', 'post', 12, 2, { _fields: 'id,parent', context: 'edit' } );

// AReturns `undefined` and makes an HTTP request.
wp.data.select( 'core' ).getRevision( 'postType', 'post', 12, 2, { context: 'edit' } );

@Mamaduka Mamaduka self-assigned this Sep 12, 2025
@Mamaduka Mamaduka added the [Type] Bug An existing feature does not function as intended label Sep 12, 2025
@Mamaduka Mamaduka requested a review from nerrad as a code owner September 12, 2025 08:37
@Mamaduka Mamaduka added the [Package] Core data /packages/core-data label Sep 12, 2025
@Mamaduka Mamaduka requested review from ramonjd and removed request for nerrad September 12, 2025 08:37
@github-actions
Copy link

github-actions bot commented Sep 12, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Flaky tests detected in 9025b67.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17669281785
📝 Reported issues:

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow up @Mamaduka 🙇🏻

Both selectors share 99% of the logic and that unfortunately includes bugs

Do you see any benefit in combining?

If I recall correctly, we kept it separate "just in case" since we didn't want to end up in the inverse situation where they share 99% of logic and we need to split it up to add custom logic 🙃

@Mamaduka
Copy link
Member Author

Do you see any benefit in combining?

I think that would be hard to do without breaking changes and increasing the complexity.

@Mamaduka Mamaduka merged commit d9289c5 into trunk Sep 15, 2025
112 of 113 checks passed
@Mamaduka Mamaduka deleted the fix/core-data-get-revision-selector branch September 15, 2025 07:24
@github-actions github-actions bot added this to the Gutenberg 21.7 milestone Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Core data /packages/core-data [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants