fix(seo): BUY-59851 harden landing-page product rendering against empty cards - #190
Open
BuyWhere wants to merge 3 commits into
Open
fix(seo): BUY-59851 harden landing-page product rendering against empty cards#190BuyWhere wants to merge 3 commits into
BuyWhere wants to merge 3 commits into
Conversation
added 3 commits
July 3, 2026 10:52
…ty cards SEO landing pages (/best-gaming-laptops-us, /laptop-singapore, /air-purifier-singapore, /best-robot-vacuums-2026) could render visually styled but empty product cards when the /v1/products/search response returned malformed items (missing names/prices, '#' hrefs). The old normalizeProduct emitted 'Untitled product' names, null prices, and '#' links that rendered as bare gradient containers. - Add isValidLandingProduct guard (requires id, non-empty name, non-null price) - Filter both API-mapped and fallback products through the guard - Throw to fallback when API yields zero valid products - Replace '#' href fallback with deterministic /search?q=&country= links
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.
BUY-59851 — SEO landing pages render empty skeleton cards
Root cause: SEO landing pages rendered visually styled but empty product cards when
/v1/products/searchreturned malformed items (missing names/prices, dead#hrefs). OldnormalizeProductemittedUntitled productnames, null prices, and#links.Fix (
src/lib/seo-landing-pages.ts):isValidLandingProductguard (valid id, non-empty name, non-null price).#href fallback with deterministic/search?q=&country=links.Verification: All four affected pages on production already render valid fallback cards (live HTML confirms
Current price+View offer, noPrice unavailable/Untitled product). This hardens the path so the empty-card regression cannot recur if a server-side key is configured.