Skip to content

Conversation

@harshit078
Copy link

@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
Author

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

expect(frames[0]?.platform).toBe('native');
expect(frames[0]?.addr_mode).toBeUndefined();
});
});
Copy link

Choose a reason for hiding this comment

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

Missing integration or E2E tests for feat PR

Low Severity · Bugbot Rules

This feat PR adds new functionality for initializing sentryWasmImages for web workers but only includes unit tests. Per the review rules file, feat PRs require at least one integration or E2E test. While the unit tests cover the core functionality (registerWebWorkerWasm, patchFrames with worker images, WASM image message processing), there's no E2E test that validates the complete flow of WASM modules loaded in workers being symbolicated correctly in captured events. The existing browser-webworker-vite E2E test application doesn't cover WASM functionality.

Additional Locations (1)

Fix in Cursor Fix in Web

(WINDOW as typeof WINDOW & { _sentryWasmImages?: Array<DebugImage> })._sentryWasmImages || [];
const newImages = event.data._sentryWasmImages.filter(
(newImg: DebugImage) => !existingImages.some(existing => existing.code_file === newImg.code_file),
);
Copy link

Choose a reason for hiding this comment

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

Missing array element validation can cause TypeError crash

Low Severity

The _sentryWasmImages validation checks only Array.isArray() but not the array elements. The processing code then accesses newImg.code_file on each element. If the array contains null or undefined (e.g., [null]), this throws a TypeError: Cannot read property 'code_file' of null. Other message fields like _sentryWorkerError use isPlainObject() validation which rejects null, but the array element validation is missing this safeguard.

Additional Locations (1)

Fix in Cursor Fix in Web

*/
export function registerWebWorkerWasm({ self }: RegisterWebWorkerWasmOptions): void {
patchWebAssemblyWithForwarding(self);
}
Copy link

Choose a reason for hiding this comment

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

Missing integration or E2E test for feature

Low Severity · Bugbot Rules

Per the review rules, feat PRs should include at least one integration or E2E test. This PR adds the registerWebWorkerWasm function and related WASM image forwarding functionality but only includes unit tests. The unit tests verify individual pieces (patching, frame processing) but don't test the complete flow of a WASM module being instantiated in a worker, the debug image being forwarded to the main thread, and then being used correctly during error symbolication.

Additional Locations (1)

Fix in Cursor Fix in Web

@harshit078
Copy link
Author

working on comments addressed by cursor !

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