-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 revisions: remove hardcoded supports constant #56701
Core data revisions: remove hardcoded supports constant #56701
Conversation
…er to determine revisions support
Size Change: -35 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all testing well for me across each of the post types, with correct responses when expected for getRevisions
and getRevision
(with the total items still passed in correctly) and no issues when making invalid calls (responses from the selector are null
as expected). Nice job reducing it down to bailing on a failed API request so we can skip the hard-coded list! LGTM ✨
Alternative to:
Part of:
What?
This PR:
POST_TYPES_WITH_REVISIONS_SUPPORT
constant in Core Data entities in order to let the server deal with permissionsapiFetch
in a try/catch and only dispatch a response if there is one.Why?
So far, we've been duplicating post type revisions support in a
POST_TYPES_WITH_REVISIONS_SUPPORT
constant.This removes that maintenance burden.
How?
Testing Instructions
Check that
getRevision(s)
works for supported post types.Example:
See the test descriptions in #56353 for other supported post types.
Test with some invalid API calls, e.g.,