Skip to content

Conversation

@harshit078
Copy link
Contributor

@harshit078 harshit078 commented Jan 14, 2026

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Closes #18779

@chargome chargome requested a review from andreiborza January 14, 2026 11:07
@andreiborza
Copy link
Member

Thanks for the contribution @harshit078. Are you done working on this or are you done (asking since it's a draft).

@harshit078 harshit078 marked this pull request as ready for review January 14, 2026 19:46
@harshit078
Copy link
Contributor Author

Hey @andreiborza , yes I have finished working on this PR and converted it to review.

@harshit078
Copy link
Contributor Author

working on comments addressed by cursor !

Copy link

@cursor cursor bot left a comment

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 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

}

try {
const { instance } = await WebAssembly.instantiateStreaming(fetch(wasmUrl), {

Check warning

Code scanning / CodeQL

Client-side request forgery Medium

The
URL
of this request depends on a
user-provided value
.
@harshit078
Copy link
Contributor Author

Hey @andreiborza , the PR is ready to review.

@andreiborza
Copy link
Member

@harshit078 awesome, thanks! I'll take a look.

}

// Handle messages from the main thread
self.addEventListener('message', async event => {

Check warning

Code scanning / CodeQL

Missing origin verification in `postMessage` handler Medium

Postmessage handler has no origin check.
/**
* Registers a WASM module and forwards its debug image to the parent thread.
*/
function registerModuleAndForward(
Copy link
Member

Choose a reason for hiding this comment

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

m: I think we should call registerModule form registry.ts in here, that way we get some deduplication going when needed. It'll also get rid of this almost identical code duplication.

We'll need to adapt registerModule to return the image so we can post it in this method.

@@ -0,0 +1,86 @@
// This worker manually just replicates what the actual Sentry.registerWebWorkerWasm() does
Copy link
Member

Choose a reason for hiding this comment

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

m: Could we highlight in the comment why we are doing that as opposed to actually using Sentry. registerWebWorkerWasm() please?

@andreiborza
Copy link
Member

@harshit078 thanks again. Just had a look, looks mostly fine to me. Just a minor comment around code duplication.

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.

Support WASM modules instantiated in web workers

2 participants