Skip to content

fix: refine community cloud search results#402

Merged
imantsk merged 4 commits into
core-betafrom
fix/community-cloud
Jun 11, 2026
Merged

fix: refine community cloud search results#402
imantsk merged 4 commits into
core-betafrom
fix/community-cloud

Conversation

@imantsk

@imantsk imantsk commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

Community Cloud search returned no results for any query (e.g. "woo", "javascript"). Two bugs in Cloud_API::fetch_search_results:

  1. Empty results even when the API responded. The refactored unpack_request_json() returns $json['data'] (a bare list), but Cloud_Snippets expects the full response envelope (it reads data/snippets, meta, available_filters). So results normalised to an empty set with total_snippets: 0. get_featured_snippets() passes the full $json and worked — search did not. Fix: pass the full decoded envelope, matching featured (and the 3.9.x behaviour).
  2. Cold-cache timeouts. wp_remote_get used WordPress's 5s default; the cloud search endpoint can take longer on a cold cache, so the request failed with cURL error 28 → empty. Fix: a 15s timeout for the search request.

Verification

Against production codesnippets.cloud: "woo" → 338 results, "javascript" → 12 (was 0/0). Confirmed the request URL/params were already correct and that the cloud API itself returns the expected data — the fault was entirely client-side parsing + timeout.

Notes

  • Stacked on fix: WordPress 7.0 admin UI compatibility #401 (branched from fix/wp7-admin-ui-compat); the diff here is the single Cloud_API change. Can be rebased onto core-beta to stand alone if preferred.
  • The slow cold-cache search is also being addressed server-side (cloud-app: fulltext-index fix), which removes the need for the long timeout over time.

@imantsk imantsk changed the title fix: restore community cloud search results fix: refine community cloud search results Jun 9, 2026
@imantsk imantsk changed the base branch from fix/wp7-admin-ui-compat to core-beta June 9, 2026 12:15
@imantsk imantsk added the run-tests Trigger automated tests label Jun 9, 2026
@imantsk imantsk force-pushed the fix/community-cloud branch from bb80313 to 47d9b22 Compare June 9, 2026 12:46
@code-snippets-bot code-snippets-bot marked this pull request as ready for review June 11, 2026 08:36
@imantsk imantsk force-pushed the fix/community-cloud branch from a88af93 to 994c744 Compare June 11, 2026 10:10
@imantsk imantsk changed the base branch from core-beta to fix/wp7-admin-ui-compat June 11, 2026 10:10
Base automatically changed from fix/wp7-admin-ui-compat to core-beta June 11, 2026 10:18
@imantsk imantsk merged commit 7ad8b04 into core-beta Jun 11, 2026
14 checks passed
@imantsk imantsk deleted the fix/community-cloud branch June 11, 2026 10:18
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