Repository navigation
fix(verified-reviews): send a JSON content-type to the reviews API - #15
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Product pages render no Verified Reviews rating or reviews.
POST https://awsapis3.netreviews.eu/productnow rejects the content-type a string body defaults to:application/jsontext/plain;charset=UTF-8(fetch default for a string body)FST_ERR_CTP_INVALID_MEDIA_TYPEThe client sent no content-type, so
ratingsandreviewsfailed, the catch returned{ review: [] }, and the failure never showed up in production telemetry:console.errordoes not reach OTel.Change
verified-reviews/utils/client.ts: the 3 POSTs sendcontent-type: application/json.context.isDeploybranches log throughlogger.error(with the HttpError) instead ofconsole.error. ThefullReviewcatch now uses its own label instead of theratingsone.Verification
1796,1799,1797,3702,3675: 28 reviews, rating 4.5 (before: HttpError 502).isDeploy+text/plain: twoERROR ... HttpError 502lines from the logger, empty result, no crash./blazer-maleavel-cinza-chumbo-0076775021/pshows "Avaliações (28)", the sheet lists the reviews, JSON-LD carriesaggregateRating. A product with no reviews renders without the button.deno task checkpassed.client.tsis identical ondeco-cx/appsmain, so the same patch goes upstream.🤖 Generated with Claude Code