Skip to content

fix(channels): health page baked empty stats — data-key filename mismatch - #2167

Merged
jung-thomas merged 1 commit into
DEVfrom
fix/channels-stats-data-key
Sep 6, 2026
Merged

fix(channels): health page baked empty stats — data-key filename mismatch#2167
jung-thomas merged 1 commit into
DEVfrom
fix/channels-stats-data-key

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Problem

The Phase 1 /channels/health/ page shipped showing "Total channels: 0" on DEV. The channels-health island reads baked #channels-stats-data, which the Hugo layout injects from .Site.Data.channels_stats. That key never resolved → default dict{}.

Root cause

fetch-channels-stats.ts wrote hugo/data/channels-stats.json (hyphen). Hugo 0.147 does not convert hyphens to underscores in data filenames (PR #2166's plan premise was wrong — every working sibling script writes an underscore filename: channel_collections.json, verb_definitions.json, topic_clusters.json). So the file was exposed under key channels-stats, not channels_stats.

The data, the /build/channels-stats endpoint (returns total=236), and the media-diet surface were all fine — only the health page's data binding was dead.

Fix

  • scripts/fetch-channels-stats.ts: output hugo/data/channels_stats.json (underscore), matching layout + sibling convention. Layout unchanged.
  • hugo/data/.gitignore: track the renamed artifact name.

Verification

Local rebuild after fix: baked #channels-stats-data now {"activeVsInactive":{"active":231,"inactive":5},..."total":236}; <noscript> reads "Total channels: 236"; page 64400→68469 bytes. Will confirm live on DEV after deploy.

…erscore)

Hugo does not convert hyphens to underscores in data filenames (the Phase 1
plan's premise was wrong). fetch-channels-stats.ts wrote channels-stats.json
but the health layout reads .Site.Data.channels_stats, so the key never
resolved and the page baked {} → 'Total channels: 0'. Rename the output to
channels_stats.json, matching the sibling convention (channel_collections.json,
verb_definitions.json). Layout unchanged. Verified: baked stats now total=236.
@jung-thomas
jung-thomas merged commit ef7242e into DEV Sep 6, 2026
3 checks passed
@jung-thomas
jung-thomas deleted the fix/channels-stats-data-key branch September 6, 2026 00:40
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