Skip to content

fix(ui): avoid crypto.randomUUID crash on LAN HTTP showcase #332

@w7-mgfcode

Description

@w7-mgfcode

Summary

On http://10.0.0.226:5173/showcase (any LAN-IP origin served over plain HTTP), the Showcase page white-screens at pipeline completion.

Error

TypeError: crypto.randomUUID is not a function

Cause

crypto.randomUUID() is only available in a secure context (HTTPS or localhost). A LAN-IP HTTP origin has window.isSecureContext === false, so crypto.randomUUID is undefined. When the run completes and the completion-path component (e.g. RunHistoryStrip generating a run-entry id) calls it, the uncaught TypeError unmounts the whole React tree → blank page.

Impact

  • The backend pipeline completes successfully (runs registered, ops snapshot computed, scenario plans persisted) — this is purely a frontend runtime crash on the completion render.
  • Reads as a "hang at step 21": the page freezes/blanks while the backend keeps going.
  • Anyone demoing the showcase over a LAN URL (not localhost) sees a white screen at the end.

Repro

  1. Serve the stack LAN-reachable (frontend on a LAN IP over HTTP).
  2. Open http://<lan-ip>:5173/showcase.
  3. Run showcase_rich (or any scenario) and wait for completion.
  4. Page white-screens; devtools console shows crypto.randomUUID is not a function.

Confirmed via Playwright: http://localhost:5173/showcaseisSecureContext=true, crypto.randomUUID is a function (works); http://<lan-ip>:5173/showcaseisSecureContext=false, crypto.randomUUID is undefined (crashes).

Suggested fix

Use a safe UUID helper with a fallback instead of calling crypto.randomUUID() directly (e.g. fall back to a Math.random-based v4 generator or a small uuid util when crypto.randomUUID is unavailable). Audit other crypto.randomUUID call sites in frontend/ for the same issue.

Scope

Separate from PRP-42 PR2 (docs/screenshots) — found during that dogfood. Frontend-only fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions