codeburn/dash
Resham Joshi 22d5fc1743
Some checks failed
CI / semgrep (push) Has been cancelled
perf(web): instant dashboard load, default to today, fast-fail offline peers (#573)
The web server is long-lived, so cache what the per-invocation CLI cannot:

- Cache the parsed local payload in-memory (single-flight, 180s TTL matched to
  the parser session cache, expired entries pruned on write). /api/usage and the
  local half of /api/devices now return from a Map hit after the first parse.
- Prewarm today at startup and inline that payload into index.html as a
  bootstrap, so the SPA paints today's numbers with no round-trip. Only the
  local device is embedded; '<' is escaped so a name cannot break the script
  tag; served no-store; the seeded view refetches at once so live peers appear.
- Default the web command and dashboard to today.
- Cap the peer connect phase at 3s. req.setTimeout does not abort a stalled TCP
  connect, so an offline paired device hung ~75s on the OS timeout; it now
  degrades to an unreachable row in ~3s. The cap clears on TCP connect, so the
  TLS handshake and the 65s pairing-approval wait are unaffected.

Measured: /api/usage 0.0007s warm (was ~0.22s), /api/devices ~3s with an offline
peer (was ~75s), first paint instant.
2026-06-29 04:21:36 +02:00
..
public feat(web): in-dashboard device discovery, share-from-browser, redesign + hardening (#534) 2026-06-20 19:02:03 +02:00
src perf(web): instant dashboard load, default to today, fast-fail offline peers (#573) 2026-06-29 04:21:36 +02:00
index.html feat(web): in-dashboard device discovery, share-from-browser, redesign + hardening (#534) 2026-06-20 19:02:03 +02:00
package-lock.json feat(web): local React dashboard served by codeburn web (#531) 2026-06-20 16:21:25 +02:00
package.json feat(web): local React dashboard served by codeburn web (#531) 2026-06-20 16:21:25 +02:00
tsconfig.json feat(web): local React dashboard served by codeburn web (#531) 2026-06-20 16:21:25 +02:00
vite.config.ts feat(web): local React dashboard served by codeburn web (#531) 2026-06-20 16:21:25 +02:00