Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Jan 27, 2026

Previously, when the compression worker failed to load (e.g., due to CSP
restrictions, network issues), Sentry captured a generic ErrorEvent with
almost no useful information ("Event: Event Event (type=error)").

This change wraps worker errors in descriptive Error objects that explain
what failed and common causes, making debugging significantly easier.

Fixes JAVASCRIPT-337J

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

…load

Previously, when the compression worker failed to load (e.g., due to CSP
restrictions, network issues), Sentry captured a generic ErrorEvent with
almost no useful information ("Event: Event `Event` (type=error)").

This change wraps worker errors in descriptive Error objects that explain
what failed and common causes, making debugging significantly easier.

Fixes JAVASCRIPT-337J

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.32 kB - -
@sentry/browser - with treeshaking flags 23.83 kB - -
@sentry/browser (incl. Tracing) 42.14 kB - -
@sentry/browser (incl. Tracing, Profiling) 46.78 kB - -
@sentry/browser (incl. Tracing, Replay) 80.88 kB +0.16% +126 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.52 kB +0.18% +123 B 🔺
⛔️ @sentry/browser (incl. Tracing, Replay with Canvas) (max: 85.5 kB) 85.59 kB +0.16% +129 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 97.78 kB +0.14% +127 B 🔺
@sentry/browser (incl. Feedback) 42.04 kB - -
@sentry/browser (incl. sendFeedback) 30.01 kB - -
@sentry/browser (incl. FeedbackAsync) 35.01 kB - -
@sentry/browser (incl. Metrics) 26.43 kB - -
@sentry/browser (incl. Logs) 26.57 kB - -
@sentry/browser (incl. Metrics & Logs) 27.24 kB - -
@sentry/react 27.05 kB - -
@sentry/react (incl. Tracing) 44.37 kB - -
@sentry/vue 29.76 kB - -
@sentry/vue (incl. Tracing) 43.93 kB - -
@sentry/svelte 25.33 kB - -
CDN Bundle 27.89 kB - -
CDN Bundle (incl. Tracing) 42.93 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 43.75 kB - -
CDN Bundle (incl. Tracing, Replay) 79.81 kB +0.17% +129 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 85.25 kB +0.16% +132 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.16 kB +0.15% +129 B 🔺
CDN Bundle - uncompressed 81.6 kB - -
CDN Bundle (incl. Tracing) - uncompressed 127.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 129.97 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.02 kB +0.12% +279 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 256.82 kB +0.11% +279 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 259.63 kB +0.11% +279 B 🔺
@sentry/nextjs (client) 46.73 kB - -
@sentry/sveltekit (client) 42.51 kB - -
@sentry/node-core 52.02 kB - -
@sentry/node 166.05 kB - -
@sentry/node - without tracing 93.79 kB - -
@sentry/aws-serverless 109.31 kB - -

View base workflow run

@billyvg billyvg marked this pull request as ready for review January 27, 2026 18:43
@billyvg billyvg requested a review from a team as a code owner January 27, 2026 18:43
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.

new Error(
`Failed to load Replay compression worker: ${error instanceof ErrorEvent && error.message ? error.message : 'Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load.'}`,
),
);
Copy link

Choose a reason for hiding this comment

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

Missing test for improved error message regression fix

Low Severity · Bugbot Rules

This PR improves error messages when the compression worker fails to load, but no tests were added to verify the improved error messages are actually produced. The existing test at EventBufferProxy.test.ts only checks that the fallback buffer is used when the worker fails, not that the new descriptive Error objects are correctly constructed and rejected with the expected messages. Per the review rules: "When reviewing a fix PR, check if the PR includes at least one unit, integration or e2e test that tests the regression this PR fixes."

Additional Locations (1)

Fix in Cursor Fix in Web

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.

2 participants