mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-01 04:15:53 +00:00
Performance and coherence: - Settings > General 'Refresh every' (Manual/30s/1m/3m/5m/10m), live via RefreshCadenceContext; Manual polls only on demand - usePolled memoKey LRU: provider/period switches paint the last-good result instantly with a switching hairline while refreshing quietly - quota TTL 5min + honest rate-limited copy on 429 backoff - version-suffixed cache files (session-cache.v5.json, daily-cache.v12, auto-minted on future bumps); legacy files never written or deleted, adopted once when versions match: old and new binaries coexist without clobbering (field-observed menubar-vs-desktop ping-pong) - advisory hydration lock: concurrent cold starts share one scan (wait-then-read-warm), stale/dead locks self-heal, never a correctness gate Telemetry v1 + onboarding (desktop only, per owner decisions): - first-launch onboarding (3 feature screens + consent); region-split default (EU/EEA/UK/CH off, elsewhere on, unknown off); nothing sends before consent completion or while off; dev builds never send - anonymous install UUID, rotated on opt-out; day-granularity events, cost buckets only; whitelisted names; 200-event queue, 5min flush - Settings > Privacy live toggle replaces the static claim Zero computed-number changes. App 316/316, root 1805. Wire contract targets api.codeburn.app/v1/telemetry (Worker follows).
13 lines
681 B
TypeScript
13 lines
681 B
TypeScript
import '@testing-library/jest-dom/vitest'
|
|
import { afterEach } from 'vitest'
|
|
|
|
// Only wire DOM cleanup in a browser-like (jsdom) environment; node-env tests
|
|
// (cli/main) have no document and must not import RTL's DOM cleanup — nor the
|
|
// renderer hook graph (usePolled → ipc touches `window` at load).
|
|
if (typeof document !== 'undefined') {
|
|
const { cleanup } = await import('@testing-library/react')
|
|
// The usePolled memo is module-level and persists across renders; clear it
|
|
// between tests so a cached result from one test never seeds another.
|
|
const { __resetPolledMemo } = await import('../hooks/usePolled')
|
|
afterEach(() => { cleanup(); __resetPolledMemo() })
|
|
}
|