-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(replay): Improve error messages when compression worker fails to load #19008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…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>
size-limit report 📦
|
There was a problem hiding this 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.'}`, | ||
| ), | ||
| ); |
There was a problem hiding this comment.
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."
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