Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/lib/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,15 @@ async function specToBenchmark(
// with no Prom data just doesn't show up in bestPerChain.
let bestPerChain: Record<string, ProviderResult> | undefined;
let worstPerChain: Record<string, ProviderResult> | undefined;
if (!isFiltered && spec.dimensions?.chain && spec.dimensions.chain.length > 0) {
// Compute per-chain leaders for BOTH unfiltered and filtered views.
// Filtered variants are pre-fetched by the page (one per chain × region
// combo) and end up in the RSC payload; their findings/seo_intro/faq
// reference `{{best_name:chain:X}}` for ALL chains, not just the
// currently selected one, so each variant needs the full stash to
// resolve those placeholders. Cached per (slug, filterSig) via
// loadBenchmarkFiltered's unstable_cache so the extra Prom roundtrips
// are paid once per variant, not per request.
if (spec.dimensions?.chain && spec.dimensions.chain.length > 0) {
const chainValues = spec.dimensions.chain
.map((c) => c.value)
.filter((v) => v !== "all");
Expand Down
Loading