Skip to content

fix(browser): restore HTTP LAN and VPN access - #494

Merged
andrebrait merged 1 commit into
mainfrom
fix/http-uuid-493
Nov 14, 2026
Merged

andrebrait merged 1 commit into
mainfrom
fix/http-uuid-493

Conversation

@andrebrait

@andrebrait andrebrait commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes Bug: v0.7.1 crashes over HTTP LAN/VPN — crypto.randomUUID unavailable #493: replace unguarded browser crypto.randomUUID calls with an HTTP-compatible UUID v4 generator.
  • Reuse the existing getRandomValues upload algorithm; migrate upload and clone callers without changing their UUID format.
  • Add regression coverage for missing randomUUID and UUID version, variant and distinctness.

Verification

  • 31 focused UUID and event-stream tests pass with the repository-required 30-second timeout.
  • Typecheck, changed-file ESLint and client build pass.
  • Real WebKit loads the app over plain HTTP at a LAN IP with isSecureContext=false and crypto.randomUUID undefined. Isolated preview has no daemon/runner, so live session creation was not exercised.
  • One condensed adversarial review found no actionable defects.
  • Initial test invocation used Bun’s default 5-second timeout and timed out in the existing nonresponsive service-worker test; using the prescribed timeout passed.
  • Build retains CSS highlight selector warnings. Preview logs the unsupported interactive-widget warning and missing-runner provider-usage 502.

Review delivery

This worker has no pr-watcher command or active service; automatic CI/review delivery could not be registered.

ESLint completed with zero errors and five existing React hook-dependency warnings in AppShell. Codex and CodeRabbit activity is established in this base repository and the authenticated account has admin/write access; review requests remain pending CI readiness.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed crashes when opening the app or creating a session over HTTP on a LAN or VPN.
    • UUID generation no longer relies on a browser feature restricted to secure contexts.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

UUID generation now uses a helper based on crypto.getRandomValues(). Session, upload, and transport code uses the helper in place of crypto.randomUUID() or the removed upload-specific generator.

Changes: HTTP-compatible UUID generation

Layer / File(s) Summary
UUID helper and validation
lib/random-uuid.ts, lib/random-uuid.test.mjs, CHANGELOG.md
A new helper generates UUID v4 values using crypto.getRandomValues(). Tests check UUID formatting and uniqueness. The changelog records the HTTP LAN/VPN fix.
Session ID creation
components/AppShell.tsx
Session creation paths use the helper to generate IDs. A supplied creation ID remains in use when present.
Transport and upload IDs
lib/event-stream.ts, components/ChatInput.tsx, components/DirectoryPicker.tsx
The helper generates transport lock names, upload IDs, and clone IDs. The newUploadId export is removed.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: abread, kahme247

Merge Risk: Minimal · up to ac70d

This change restores HTTP LAN and VPN access by generating IDs without secure-context-only crypto.randomUUID(). No actionable merge-blocking risk was found.

Security architecture risk: Minimal · up to ac70d

The change preserves cryptographically random UUID v4 identifiers and existing upload retry and cancellation identities. No introduced or worsened security, ownership or failure-containment risk was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A defect in the shared generator could affect identifier creation across sessions, attachments, clone operations and transport lifetime locks. The inspected implementation preserves the prior UUID properties rather than adding a new source of authority.

Trust Boundaries and Controls

  • inferred — The inspected upload path still separates client-generated identity from host selection and returned proof. The generator substitution does not itself add credentials, select another host or bypass an authorization check; comprehensive server-side authorization remains outside this assessment.

Resilience and Maintainability Implications

  • observed — Cancellation remains idempotent per upload handle and discards the same ID and host. Settlement checks handle identity before updating the composer. HTTP 410 still assigns a fresh ID and clears the proof, keeping pending cancellation of the old identity separate from a subsequent retry.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(browser): restore HTTP LAN and VPN access" names the main change. The PR replaces the unguarded crypto.randomUUID() calls with an HTTP-compatible UUID v4 generator (lib/random-uuid.ts),…
Linked Issues check Passed Issue #493 requires OMPWeb to load over plain HTTP LAN/VPN origins, where crypto.randomUUID is undefined, and suggests a crypto.getRandomValues() fallback. At head, lib/random-uuid.ts exports randomUU…
Out of Scope Changes check Passed All changed files relate to replacing secure-context-only UUID generation with the new helper. The changes are: the new lib/random-uuid.ts helper and its tests; call-site migrations in AppShell.tsx, C…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "fix(browser): restore HTTP LAN and VPN access" names the main change. The PR replaces the unguarded crypto.randomUUID() calls with an HTTP-compatible UUID v4 generator (lib/random-uuid.ts), which fixes the crash when the app is opened over plain HTTP on a LAN or VPN address (issue #493). The title is specific and matches the changeset and linked issue objectives.

Full details: Linked Issues check

Explanation

Issue #493 requires OMPWeb to load over plain HTTP LAN/VPN origins, where crypto.randomUUID is undefined, and suggests a crypto.getRandomValues() fallback. At head, lib/random-uuid.ts exports randomUUID(), which builds a UUID v4 from crypto.getRandomValues(new Uint8Array(16)). It sets the version nibble (0x40 on byte 6) and the variant bits (0x80 on byte 8) and formats the hex string correctly. The PR routes the reported call paths through this helper: AppShell.tsx (session creation), ChatInput.tsx (upload IDs), DirectoryPicker.tsx (clone IDs) and lib/event-stream.ts (holdLifetimeLock lock name and default upload ID). Regression tests in lib/random-uuid.test.mjs cover the missing-randomUUID path, UUID v4 format for 100 generated values, and distinctness. The author reports a real WebKit check over plain HTTP at a LAN IP with isSecureContext=false, which loaded the app. Live session creation was not exercised. Residual uncertainty: this assessment used the change summary and the helper source. It did not search the whole repository for other crypto.randomUUID call sites, so no other unguarded call site can be ruled out from the evidence reviewed.

Full details: Out of Scope Changes check

Explanation

All changed files relate to replacing secure-context-only UUID generation with the new helper. The changes are: the new lib/random-uuid.ts helper and its tests; call-site migrations in AppShell.tsx, ChatInput.tsx, DirectoryPicker.tsx and lib/event-stream.ts; removal of the exported newUploadId from lib/event-stream.ts, which now has no callers in the reviewed changes; and a CHANGELOG.md fix entry that documents the change. The author reports that typecheck and the client build pass, which supports that no remaining importer of newUploadId exists. The UUID format used by upload and clone callers is preserved, per the PR description. No unrelated functional change was identified in the summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39897309-3fac-4abd-a0cd-6834c9df42e4
Commits

Reviewing files that changed from the base of the PR and between 1f4a4bb and ac70d1d.

Files selected for processing: 7

  • CHANGELOG.md
  • components/AppShell.tsx
  • components/ChatInput.tsx
  • components/DirectoryPicker.tsx
  • lib/event-stream.ts
  • lib/random-uuid.test.mjs
  • lib/random-uuid.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@andrebrait
andrebrait merged commit 8264f8f into main Nov 14, 2026
4 checks passed
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.

Bug: v0.7.1 crashes over HTTP LAN/VPN — crypto.randomUUID unavailable

1 participant