This repository was archived by the owner on Nov 2, 2026. It is now read-only.
Repository navigation
fix(abilities): drop empty properties maps so core's JS client can compile input schemas - #474
Merged
Merged
Conversation
…mpile input schemas
Contributor
Homeboy Results —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Once extrachill-community v1.27.6 (#326) ships, the community Settings block runs
extrachill/get-user-settingsandextrachill/get-notification-preferencesthrough core's@wordpress/abilitiesclient. Both currently declare:Core's
wp_prepare_json_schema_for_client()casts the emptydefaultto{}, but publishes the emptypropertiesmap as JSON[]. Gutenberg'sexecuteAbility()compiles the schema with ajv first, getsschema is invalid: data/properties must be object, and throwsInvalid schema provided for validation.before any request goes out. The Settings page stays on "Loading settings...".The extrachill-network journey
community-member-blockscaught it: on a fresh network boot with community v1.27.6, Edit Profile, the leaderboard and the heatmap all pass, and Settings never gets past "Loading settings...".Fix
Drop the six empty
propertieskeys in this plugin. An empty map adds no constraints, so server-side validation is unchanged, and{type: object, default: {}}compiles and validates{}under ajv.Test
OptionalAbilityInputTest::test_published_input_schemas_have_object_property_mapschecks that no published users input schema contains"properties":[], and pins both Settings abilities.Follow-ups
json-schema.phpstill recurses intopropertieswithout turning an empty map into{}. Report it upstream.extrachill/*anddatamachine/*abilities still declare'properties' => array(); tracked separately.AI assistance: Claude (Extra Chill Bot) wrote this change.