Skip to content

fix(wasm): Register modules loaded via non-streaming WebAssembly APIs - #23403

Draft
andreiborza wants to merge 1 commit into
developfrom
ab/fix-wasm-non-streaming
Draft

fix(wasm): Register modules loaded via non-streaming WebAssembly APIs#23403
andreiborza wants to merge 1 commit into
developfrom
ab/fix-wasm-non-streaming

Conversation

@andreiborza

Copy link
Copy Markdown
Member

What

Register WASM modules that are loaded via WebAssembly.instantiate(buffer), WebAssembly.compile, and new 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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ 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]!);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

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>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 94646d2. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 30.3 kB - -
@sentry/browser - with treeshaking flags 28.47 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.81 kB - -
@sentry/browser (incl. Tracing) 48.57 kB +0.05% +23 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.58 kB +0.05% +22 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.45 kB +0.04% +18 B 🔺
@sentry/browser (incl. Tracing, Replay) 87.97 kB +0.04% +28 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.35 kB +0.04% +25 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.69 kB +0.03% +24 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 105.38 kB +0.02% +18 B 🔺
@sentry/browser (incl. Feedback) 47.65 kB - -
@sentry/browser (incl. sendFeedback) 35.13 kB - -
@sentry/browser (incl. FeedbackAsync) 40.28 kB - -
@sentry/browser (incl. Metrics) 31.24 kB - -
@sentry/browser (incl. Logs) 31.52 kB - -
@sentry/browser (incl. Metrics & Logs) 32.15 kB - -
@sentry/react 32.09 kB - -
@sentry/react (incl. Tracing) 50.76 kB +0.05% +22 B 🔺
@sentry/vue 35.33 kB +0.06% +20 B 🔺
@sentry/vue (incl. Tracing) 50.53 kB +0.07% +31 B 🔺
@sentry/svelte 30.33 kB - -
CDN Bundle 31.61 kB - -
CDN Bundle (incl. Tracing) 48.88 kB +0.04% +16 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.8 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.81 kB +0.03% +12 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.31 kB - -
CDN Bundle (incl. Tracing, Replay) 86.47 kB +0.02% +9 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.3 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.17 kB +0.02% +10 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.11 kB +0.01% +2 B 🔺
CDN Bundle - uncompressed 93.84 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.7 kB -0.02% -20 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.39 kB -0.02% -20 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.08 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.96 kB -0.01% -20 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.63 kB -0.01% -20 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.65 kB -0.01% -20 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.32 kB -0.01% -20 B 🔽
@sentry/nextjs (client) 53.28 kB +0.04% +21 B 🔺
@sentry/sveltekit (client) 48.99 kB +0.07% +30 B 🔺
@sentry/core/server 65.36 kB +0.04% +21 B 🔺
@sentry/core/browser 51.69 kB +0.02% +6 B 🔺
@sentry/node 117.13 kB -0.46% -541 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 81.42 kB -0.78% -638 B 🔽
@sentry/aws-serverless 90.91 kB -0.61% -556 B 🔽
@sentry/cloudflare (withSentry) - minified 213.94 kB -0.03% -52 B 🔽
@sentry/cloudflare (withSentry) 528.8 kB +0.01% +29 B 🔺

View base workflow run

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.

Non-streaming WebAssembly APIs are not intercepted breaking symbolication

1 participant