You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shared TTL-memo utility with a test-reset registry for process-global caches #1042
Six hand-rolled process-global caches exist today: runnerSessions, the simulator booted-memo (simulator.ts), the device-ready cache (device-ready.ts), runner idle-stop timers, the apple-tool fingerprint cache (runner-xctestrun.ts), and the device tunnel-IP cache (runner-transport.ts). Each reinvents TTL bookkeeping and its own __resetXForTests. This bug class fired three times in one week: booted-memo leaked across tests in index.test.ts (needed a hand-added reset), and two separate mock-reset omissions in session.test.ts (one caught by external review on #1025).
Expectation
A small src/utils/ttl-memo.ts (get/set/delete, TTL, unref'd timers where applicable) plus a module-level registry that a single shared test helper can reset (resetAllProcessMemosForTests()), wired into the common test setup so new memos are reset by construction. Migrate at least booted-memo, device-ready cache, and fingerprint cache to prove the shape; the rest can follow. Acceptance: no per-cache reset exports needed in new code; existing suites green; a test that deliberately leaks a memo across two tests fails without the registry reset and passes with it.
Activity