diff --git a/ui/src/views/Forecast.jsx b/ui/src/views/Forecast.jsx index d8f3745..e1718d5 100644 --- a/ui/src/views/Forecast.jsx +++ b/ui/src/views/Forecast.jsx @@ -669,7 +669,16 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio if (!sourceId) { setDimMembers({}); return } let cancelled = false ;(async () => { - const meta = colMetaRef.current + // col_meta is fetched here rather than read from colMetaRef: that ref is + // filled inside initViewer, which is async, so this effect ran first, saw an + // empty array, found no groups and never fetched a list -- and a ref changing + // does not re-run an effect, so it never recovered. It is a small query and + // the browser will serve it from cache anyway. + let meta = [] + try { + meta = await fetch(`/api/sources/${sourceId}/cols`).then(r => r.ok ? r.json() : []) + } catch { return } + if (cancelled) return const groups = [...new Set(meta.filter(c => c.dim_group && c.is_key).map(c => c.dim_group))] const loaded = {} for (const g of groups) {