Fixes #371
Summary#
crypto.randomUUID() is only available in secure contexts (HTTPS or localhost). When the app is accessed over plain HTTP on a non-localhost address (e.g. a LAN IP), calls to it throw a TypeError.
Changes#
- Add a
randomUUID() helper in apps/web/src/lib/utils.ts that delegates to crypto.randomUUID() when available, and falls back to crypto.getRandomValues() otherwise
- Replace all direct
crypto.randomUUID() calls in ChatView.tsx with the new helper
Note
Polyfill crypto.randomUUID for non-secure HTTP contexts in web app#
Introduces a randomUUID() wrapper in lib/utils.ts that calls crypto.randomUUID when available and falls back to Effect.runSync(Random.nextUUIDv4) when it is not (e.g. non-HTTPS contexts where crypto.randomUUID is undefined).
- All ID generation in
lib/utils.ts (newCommandId, newProjectId, newThreadId, newMessageId) now uses the wrapper.
- All UUID usage in
ChatView.tsx (terminal IDs, worktree branch names, image attachment IDs) is updated to use the wrapper.
Macroscope summarized 3028ffc.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
b62c8965-424c-4f0b-927b-a0301bc0e663You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share