Bug
The missing-ability fallback in DataMachine\Api\ProcessedItems::handle_clear() calls wp_get_ability() directly. WordPress core emits an incorrect-usage notice when the ability is not registered before returning null, so the endpoint cannot cleanly return its intended safe ability_not_found error.
Reproduction
On PR #3361 head 1c5d76757, MySQL shard 2 fails:
DataMachine\Tests\Unit\Api\ProcessedItemsEndpointTest::test_handle_clear_returns_safe_error_when_ability_is_missing
Unexpected incorrect usage notice for WP_Abilities_Registry::get_registered.
GitHub job: https://github.com/Extra-Chill/data-machine/actions/runs/32732417352/job/97452519639
The other three shards and all quality gates pass.
Expected
The endpoint should check registration through WP_Abilities_Registry::is_registered() before resolving the ability, then return the existing ability_not_found / HTTP 500 WP_Error without an incorrect-usage notice. Preserve the route, permission, input, ability execution, and response contracts.
Constraints
- Fix the missing-ability path at the owning REST adapter.
- Do not suppress
_doing_it_wrong or weaken the test.
- Retain executable coverage for the clean missing-ability response.
Found during final #2424 package certification on #3361.
Bug
The missing-ability fallback in
DataMachine\Api\ProcessedItems::handle_clear()callswp_get_ability()directly. WordPress core emits an incorrect-usage notice when the ability is not registered before returningnull, so the endpoint cannot cleanly return its intended safeability_not_founderror.Reproduction
On PR #3361 head
1c5d76757, MySQL shard 2 fails:GitHub job: https://github.com/Extra-Chill/data-machine/actions/runs/32732417352/job/97452519639
The other three shards and all quality gates pass.
Expected
The endpoint should check registration through
WP_Abilities_Registry::is_registered()before resolving the ability, then return the existingability_not_found/ HTTP 500WP_Errorwithout an incorrect-usage notice. Preserve the route, permission, input, ability execution, and response contracts.Constraints
_doing_it_wrongor weaken the test.Found during final #2424 package certification on #3361.