Skip to content

fix(products): badge URLs use raw bench slug, not canonical product slug#760

Merged
Flotapponnier merged 1 commit into
mainfrom
fix/product-badges-raw-slug
Jun 26, 2026
Merged

fix(products): badge URLs use raw bench slug, not canonical product slug#760
Flotapponnier merged 1 commit into
mainfrom
fix/product-badges-raw-slug

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Bug

Product pages generate broken badge URLs whenever the URL slug aliases a different bench-level provider slug:

  • /products/publicnode → `/api/badge/gas-estimation/publicnode` → 404 (bench provider is `publicnode-feehistory`)
  • /products/polygon → `/api/badge/oracle-deviation/polygon` → 404 (bench provider is `matic-usd`)

Found in audit (Ahrefs Patches): 4 broken image URLs across publicnode, polygon, publicnode-feehistory product pages.

Root cause

`badgeCards.push(...)` used `p.slug` (canonical product slug from URL params) in the badge URL, but the `/api/badge/[bench]/[provider]` route is keyed by the bench's raw result slug. Aliases like `PRODUCT_ALIASES = { "publicnode-feehistory": "publicnode", "matic-usd": "polygon" }` collapse multiple bench providers under one canonical product, breaking the badge URL.

Fix

Capture `providerSlug = a.result.slug` (the raw bench-level slug, available in the loop) and use it in the badge URL instead of `p.slug`.

@Flotapponnier
Flotapponnier merged commit 887a128 into main Jun 26, 2026
1 check passed
@Flotapponnier
Flotapponnier deleted the fix/product-badges-raw-slug branch July 17, 2026 14:42
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