Skip to content

fix: rest backports - #397

Merged
justlevine merged 2 commits into
mainfrom
fix/rest-backports
Nov 23, 2026
Merged

justlevine merged 2 commits into
mainfrom
fix/rest-backports

Conversation

@justlevine

@justlevine justlevine commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • On VIP, every 502 and 503 from a OneSearch REST route now has the x-vip-reached-origin header. Before this only the brand site save did.
  • Remote_Client::request_brand_site() now matches OneDesign's helper. It's public with OneDesign's signature, decodes the brand site's answer once, and gives transport errors and the rejected key error a status. The callers use the decoded answer instead of decoding it themselves.

Why

Related Issue(s):

How

  • Abstract_REST_Controller adds the header to any 502 or 503 on onesearch/v1 when VIP_GO_APP_ENVIRONMENT is defined, the same way OneDesign does, and set_shared_sites() drops its own check.
  • request_brand_site( $site_data, $route, $method, $body ) is OneDesign's. Transport errors get a 502, the rejected key error gets OneDesign's copy and a 400, and an answer that isn't a JSON array is "The brand site returned an invalid response." The callers and the Indexer status use the decoded answer and that copy.
  • Ports OneDesign's tests for both.

AI Disclosure

Backported by Opus 5.5, reviewed by me

Testing Instructions

Screenshots

Additional Info

Checklist

  • I have read the Contribution Guidelines.
  • I have read the Development Guidelines.
  • I have added necessary tests to cover my changes.
  • I have updated the project documentation as needed.
  • My code has detailed inline documentation.
  • My code is tested to the best of my abilities.
  • My code passes all lints, tests, and checks.
Open WordPress Playground Preview

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.83%. Comparing base (19f4d4d) to head (ace557e).

Files with missing lines Patch % Lines
inc/Modules/Rest/Remote_Client.php 93.75% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #397      +/-   ##
============================================
+ Coverage     90.78%   91.83%   +1.04%     
- Complexity      887      888       +1     
============================================
  Files            51       37      -14     
  Lines          3333     2708     -625     
  Branches        182        0     -182     
============================================
- Hits           3026     2487     -539     
+ Misses          255      221      -34     
+ Partials         52        0      -52     
Flag Coverage Δ
unit 91.83% <96.00%> (-0.01%) ⬇️
vitest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
inc/Modules/Rest/Abstract_REST_Controller.php 96.66% <100.00%> (+1.01%) ⬆️
inc/Modules/Rest/Indexer_Controller.php 99.09% <100.00%> (ø)
inc/Modules/Rest/Shared_Sites_Controller.php 98.55% <100.00%> (+1.32%) ⬆️
inc/Modules/Rest/Remote_Client.php 86.75% <93.75%> (-0.75%) ⬇️

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@justlevine
justlevine requested a review from Kallyan01 November 20, 2026 13:15
@justlevine
justlevine merged commit ea2401a into main Nov 23, 2026
19 checks passed
@justlevine
justlevine deleted the fix/rest-backports branch November 23, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants