Skip to content

fix: fallback for crypto.randomUUID on non-HTTPS connections#9

Open
dalager wants to merge 1 commit intorwliebs:mainfrom
dalager:fix/crypto-random-uuid-http-fallback
Open

fix: fallback for crypto.randomUUID on non-HTTPS connections#9
dalager wants to merge 1 commit intorwliebs:mainfrom
dalager:fix/crypto-random-uuid-http-fallback

Conversation

@dalager
Copy link

@dalager dalager commented Mar 8, 2026

Fixes #7

Summary

  • crypto.randomUUID() requires a secure context (HTTPS or localhost) and throws when the app is accessed over plain HTTP on a LAN
  • Adds a fallback (Date.now + Math.random) for the chat message ID in left-sidebar.tsx, which only serves as a React list key
  • All other crypto.randomUUID() calls are server-side (Node.js) and unaffected

Notes

This might be a blunt fallback, and either one would expect to run on https or delegate key-generation to an isolated function. So no hard feelings if rejecting. Just sharing my path to victory 😸

Test plan

  • Access Dossier over HTTP on a LAN (e.g. http://192.168.x.x:3000)
  • Send a chat message — verify it renders without errors
  • Verify HTTPS/localhost still works as before

🤖 Generated with Claude Code

crypto.randomUUID() requires a secure context (HTTPS or localhost) and
throws when the app is accessed over plain HTTP on a LAN. Add a fallback
using Date.now + Math.random for the chat message ID, which only serves
as a React list key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App crashes over HTTP — crypto.randomUUID() requires secure context

1 participant