Skip to content

fix: parse the full cloud API response envelope#406

Merged
imantsk merged 2 commits into
core-betafrom
fix/cloud-response-parsing
Jun 17, 2026
Merged

fix: parse the full cloud API response envelope#406
imantsk merged 2 commits into
core-betafrom
fix/cloud-response-parsing

Conversation

@imantsk

@imantsk imantsk commented Jun 15, 2026

Copy link
Copy Markdown
Member

The unified unpack_request_json helper returned only $json['data'], but the callers each need a different key from the full response: search reads snippets/meta/available_filters, get_single_snippet_from_cloud reads snippet, and the taxonomy fetches read data. As a result community search returned zero results (covered by the failing Cloud_API_Search_Test::test_returns_parsed_snippets_and_total) and single-snippet fetch hit a null dereference with no test covering it.

The helper now returns the whole decoded array and each caller extracts the key it needs. This restores search, getsnippet, types, categories, and revision with one change.

Added tests for single-snippet and revision fetches, including the empty-response paths. All 30 cloud tests pass.

Search aligns back on the snippets key; the cloud-app side drops the duplicate data from search/featured responses in a companion PR, so no further plugin change is required.

@imantsk imantsk added the run-tests Trigger automated tests label Jun 15, 2026
@imantsk imantsk merged commit df4ebf5 into core-beta Jun 17, 2026
25 checks passed
@imantsk imantsk deleted the fix/cloud-response-parsing branch June 17, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-tests Trigger automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant