pf_app
Go to file
Paul Trowbridge 0459fa137d Stop loading the whole version twice on every page load
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>
2026-09-16 22:42:38 -04:00
lib Hash pf_gkey instead of shipping the concatenated grain tuple 2026-09-16 22:07:29 -04:00
public Add UX mockup and update spec with navigation direction 2026-04-25 14:56:29 -04:00
routes Merge feature/static-grain: display-grain pre-aggregation 2026-09-16 18:08:20 -04:00
setup_sql Merge feature/static-grain: display-grain pre-aggregation 2026-09-16 18:08:20 -04:00
ui Stop loading the whole version twice on every page load 2026-09-16 22:42:38 -04:00
.env.example Put the app behind a login 2026-09-14 22:20:25 -04:00
.gitignore Refresh lockfiles and keep .env backups out of the tree 2026-09-16 17:45:58 -04:00
CLAUDE.md Merge feature/static-grain: display-grain pre-aggregation 2026-09-16 18:08:20 -04:00
install.sh Put the app behind a login 2026-09-14 22:20:25 -04:00
package-lock.json Refresh lockfiles and keep .env backups out of the tree 2026-09-16 17:45:58 -04:00
package.json Put the app behind a login 2026-09-14 22:20:25 -04:00
PERSPECTIVE.md Load Perspective from bundle, not CDN; pin all packages at 5.2.0 2026-08-17 21:30:19 -04:00
pf_perspective_options.md Record DuckDB virtual-server spike findings; choose display-grain pre-aggregation 2026-08-17 21:47:55 -04:00
pf_spec.md Merge feature/static-grain: display-grain pre-aggregation 2026-09-16 18:08:20 -04:00
pf.sh Put the app behind a login 2026-09-14 22:20:25 -04:00
server.js Put the app behind a login 2026-09-14 22:20:25 -04:00