mirror of
https://github.com/yamadashy/repomix.git
synced 2026-05-30 11:18:53 +02:00
b9388665d2
Previous memoization stored a single boolean at module scope. In any Node context where the same module instance might be reused across requests (VitePress SSG, dev server, preview server with `navigator` polyfilled per request), the first request's UA would silently leak into subsequent calls. In production this code is browser-only — Cloud Run's Hono server doesn't import `botDetect.ts`, and Cloudflare Pages serves the bundle as static files with one fresh module instance per browser tab — so the bug was theoretical. But the UA-keyed memo costs nothing extra and removes the foot-gun: a long-lived process now invalidates the cache automatically when a different UA shows up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>