fix(wasm): Register modules loaded via non-streaming WebAssembly APIs - #23403
fix(wasm): Register modules loaded via non-streaming WebAssembly APIs#23403andreiborza wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 94646d2. Configure here.
| function read64(bytes: Uint8Array, offset: number): bigint { | ||
| let value = 0n; | ||
| for (let i = 7; i >= 0; i--) { | ||
| value = (value << 8n) | BigInt(bytes[offset + i]!); |
There was a problem hiding this comment.
Non-null assertions lack safety comments
Low Severity
New non-null assertions in syntheticUrl.ts (indexed bytes reads, RAPIDHASH_SECRET accesses, and bytes[pos++] in getModuleName) have no comment on why a safer type is not possible. This is flagged because the PR review guidelines require that each ! in SDK source explain why a tighter type cannot be used.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 94646d2. Configure here.
| const origInstantiate = WebAssembly.instantiate as unknown as ( | ||
| source: unknown, | ||
| ...rest: unknown[] | ||
| ) => Promise<WebAssembly.WebAssemblyInstantiatedSource>; |
There was a problem hiding this comment.
Double cast lacks typing comment
Low Severity
WebAssembly.instantiate is coerced with as unknown as ... and no comment explaining why a safer type is not possible. This is flagged because the PR review guidelines require that new double-casts in SDK source document why a tighter type cannot be used.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 94646d2. Configure here.
| (frame: { platform?: string }) => frame.platform === 'native', | ||
| ); | ||
| expect(event.debug_meta.images[0].code_file).toBe(wasmFrame.filename); | ||
| } |
There was a problem hiding this comment.
Browser branches inside one test
Low Severity
These tests branch on browserName for expected filename and the Chromium code_file equality check. This is flagged because the testing conventions ask not to use conditionals for different paths in one test, and to split those paths instead.
Additional Locations (1)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 94646d2. Configure here.
size-limit report 📦
|


What
Register WASM modules that are loaded via
WebAssembly.instantiate(buffer),WebAssembly.compile, andnew WebAssembly.Module()so their frames get symbolicated. Modules are registered under the engine's synthetic script name (wasm://wasm/<hash>), computed from the wire bytes; Firefox frames match through a single-module fallback because its names are call-site-derived. Also forwards the compile-options argument in the streaming wrappers and patches frames of all chained exception values.Why
Non-streaming loads (Emscripten fallback and dynamic linking, Godot Web) produced events without
debug_meta, so uploaded symbols were never applied.Fixes #19564