Skip to content
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

Core Data: Fix 'getEntityRecordPermissions' memoization #64091

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

Mamaduka
Copy link
Member

What?

PR fixes memoization for the getEntityRecordPermissions private selector.

Why?

It was passing a new array of IDs on every call, which invalidated memoization.

Testing Instructions

  1. Open a post or page.
  2. Confirm there's no warning logged in the console.
  3. Confirm that the "Move to Trash" action is still visible.

Testing Instructions for Keyboard

Same.

Screenshots or screencast

CleanShot 2024-07-30 at 14 03 18

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Package] Core data /packages/core-data labels Jul 30, 2024
@Mamaduka Mamaduka self-assigned this Jul 30, 2024
@Mamaduka Mamaduka requested a review from nerrad as a code owner July 30, 2024 10:30
Copy link

github-actions bot commented Jul 30, 2024

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: youknowriad <youknowriad@git.wordpress.org>

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

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Makes sense, thank you :)

@Mamaduka Mamaduka enabled auto-merge (squash) July 30, 2024 10:57
@Mamaduka Mamaduka merged commit 02fe91a into trunk Jul 30, 2024
69 checks passed
@Mamaduka Mamaduka deleted the fix/get-entity-record-permissions-memoization branch July 30, 2024 11:04
@github-actions github-actions bot added this to the Gutenberg 19.0 milestone Jul 30, 2024
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.

2 participants