Skip to content

fix(p533): don't kill the engine on plain-HTTP hosts#1133

Merged
accius merged 1 commit into
mainfrom
fix/p533-insecure-context
Jul 11, 2026
Merged

fix(p533): don't kill the engine on plain-HTTP hosts#1133
accius merged 1 commit into
mainfrom
fix/p533-insecure-context

Conversation

@accius

@accius accius commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Fixes #1129.

Diagnosis

The reporter's screenshot shows the real error: WASM engine unavailable … (can't access property "digest", crypto.subtle is undefined). crypto.subtle only exists in secure contexts (HTTPS or localhost). A self-hosted instance reached over plain HTTP on a LAN address doesn't have it, so sha256Hex() threw during the P.533 data-file integrity check — killing the whole engine and surfacing as a WASM problem. The wasm bundle itself was installed and serving correctly (as the reporter verified), and the official instance works because it's HTTPS.

Fix

Skip the integrity check when crypto.subtle is absent, with a one-time console warning. This is safe: gzip's own CRC still catches corruption, and the bytes come from our own same-origin /api/p533-data/ proxy.

Verification

  • New test: with crypto.subtle absent, fetchAndDecompress still delivers data, the manifest hash (deliberately wrong in the fixture) is never consulted, and the warning fires exactly once across assets.
  • Full suite 1038 passing, build clean.

Same change is on Staging as 087aea6.

🤖 Generated with Claude Code

crypto.subtle only exists in secure contexts (HTTPS or localhost). On a
self-hosted instance reached over plain HTTP (http://192.168.x.x:3001),
sha256Hex() threw "crypto.subtle is undefined" during the data-file
integrity check, which took down the whole P.533 engine and surfaced as
"WASM engine unavailable" — sending self-hosters chasing a wasm install
problem that didn't exist (the wasm bundle was fine).

Skip the integrity check when crypto.subtle is absent, with a one-time
console warning. gzip's own CRC still catches corruption, and the bytes
come from our own same-origin proxy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@accius
accius merged commit 0949edc into main Jul 11, 2026
9 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] VOACAP WASM fails to load

1 participant