Skip to content

fix(verified-reviews): send a JSON content-type to the reviews API - #15

Merged
marcoferreiradev merged 1 commit into
main-altfrom
fix/verified-reviews-content-type
Sep 17, 2026
Merged

marcoferreiradev merged 1 commit into
main-altfrom
fix/verified-reviews-content-type

Conversation

@marcoferreiradev

Copy link
Copy Markdown
Collaborator

Problem

Product pages render no Verified Reviews rating or reviews. POST https://awsapis3.netreviews.eu/product now rejects the content-type a string body defaults to:

content-type status
application/json 200
text/plain;charset=UTF-8 (fetch default for a string body) 502
none 415 FST_ERR_CTP_INVALID_MEDIA_TYPE

The client sent no content-type, so ratings and reviews failed, the catch returned { review: [] }, and the failure never showed up in production telemetry: console.error does not reach OTel.

Change

  • verified-reviews/utils/client.ts: the 3 POSTs send content-type: application/json.
  • The context.isDeploy branches log through logger.error (with the HttpError) instead of console.error. The fullReview catch now uses its own label instead of the ratings one.

Verification

  • Client from this commit, products 1796,1799,1797,3702,3675: 28 reviews, rating 4.5 (before: HttpError 502).
  • Forced isDeploy + text/plain: two ERROR ... HttpError 502 lines from the logger, empty result, no crash.
  • Site pointed at this branch: PDP /blazer-maleavel-cinza-chumbo-0076775021/p shows "Avaliações (28)", the sheet lists the reviews, JSON-LD carries aggregateRating. A product with no reviews renders without the button.
  • Pre-commit deno task check passed.

client.ts is identical on deco-cx/apps main, so the same patch goes upstream.

🤖 Generated with Claude Code

The netreviews product API now rejects the text/plain content-type a
string body defaults to (502; 415 with no header), so every rating and
review call failed and product pages rendered no reviews. The failure
was invisible in production because console.error never reaches OTel;
the deploy branches now go through logger.error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@marcoferreiradev
marcoferreiradev merged commit cdfe1bd into main-alt Sep 17, 2026
4 checks passed
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.

1 participant