mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-16 04:29:29 +00:00
|
Some checks failed
CI / semgrep (push) Has been cancelled
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. |
||
|---|---|---|
| .. | ||
| approve.test.ts | ||
| connect-timeout.test.ts | ||
| host.test.ts | ||
| pairing.test.ts | ||
| sanitize.test.ts | ||
| transport.test.ts | ||