codeburn/tests/sharing
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
..
approve.test.ts feat(sharing): securely combine usage across your own devices (#532) 2026-06-20 16:24:53 +02:00
connect-timeout.test.ts perf(web): instant dashboard load, default to today, fast-fail offline peers (#573) 2026-06-29 04:21:36 +02:00
host.test.ts feat(menubar): expose combined multi-device usage in menubar-json (#566) (#567) 2026-06-28 20:59:23 +02:00
pairing.test.ts feat(web): in-dashboard device discovery, share-from-browser, redesign + hardening (#534) 2026-06-20 19:02:03 +02:00
sanitize.test.ts feat(sharing): securely combine usage across your own devices (#532) 2026-06-20 16:24:53 +02:00
transport.test.ts fix(web): reject invalid dashboard periods without exiting (#554) 2026-06-28 19:35:46 +02:00