pf_app
The version re-validation effect could not tell "the versions fetch has not landed yet" from "this source has no versions", because both look like an empty array. So a versionId restored from localStorage was cleared on the first render and set straight back when the fetch returned: 29 -> '' -> 29. Forecast's load effect is keyed on [versionId, sourceId], so that round trip ran initViewer twice. Two /agg requests, two full aggregations in Postgres, two Arrow payloads -- on version 29 that is the 285k-row aggregate computed twice at ~17s each, which is most of the "it hangs before it displays" and the Postgres process sitting at the top of htop. sourcesLoaded already guarded the identical effect for sources; versions just never got the same treatment. Cleared when the source changes, since the list belongs to the previous source until the new fetch lands. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| lib | ||
| public | ||
| routes | ||
| setup_sql | ||
| ui | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| install.sh | ||
| package-lock.json | ||
| package.json | ||
| PERSPECTIVE.md | ||
| pf_perspective_options.md | ||
| pf_spec.md | ||
| pf.sh | ||
| server.js | ||