diff --git a/ui/src/views/Forecast.jsx b/ui/src/views/Forecast.jsx index 2eb268b..26d21ce 100644 --- a/ui/src/views/Forecast.jsx +++ b/ui/src/views/Forecast.jsx @@ -698,9 +698,8 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio } async function initViewer(vid, sid) { - dbgOrder('initViewer start', { vid, sid, hasViewer: !!viewerRef.current }) const viewer = viewerRef.current - if (!viewer) return dbgOrder('initViewer: no viewer element') + if (!viewer) return const myId = ++initIdRef.current setLoading(true) setLargeDataset(false) @@ -738,7 +737,7 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio if (rowCount >= 500000) setLargeDataset(true) - if (myId !== initIdRef.current) return dbgOrder('initViewer: superseded before table') + if (myId !== initIdRef.current) return if (!workerRef.current) workerRef.current = await perspective.worker() const worker = workerRef.current @@ -811,8 +810,7 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio // by the very next line and the ordering columns never appeared in the // column list. try { - dbgOrder('reached the sync call') - await syncOrderExpressions() + await syncOrderExpressions() } catch (err) { // Its own try covers only restore(); save() and the builders sit outside // it, and a throw there would abort the rest of initViewer silently. @@ -941,8 +939,13 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio // // Removing an ordering removes its column: leaving a stale Bucket expression // behind would keep ordering by an order that no longer exists. + // Silent unless localStorage.pf_debug is set, like the rest of the tracing. + // Kept rather than removed: it took several rounds to work out that this ran + // before its inputs existed, and it will be wanted again. function dbgOrder(msg, extra) { - console.log(`[pf-order] ${msg}`, extra) + try { if (!localStorage.getItem('pf_debug')) return } catch { return } + if (extra === undefined) console.log(`[pf-order] ${msg}`) + else console.log(`[pf-order] ${msg}`, extra) } // Fetches its own inputs rather than reading the `versions` prop and the