-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(js-loader): Support logs+metrics bundle #106959
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: master
Are you sure you want to change the base?
Conversation
| if is_v7_sdk and not has_replay and not has_feedback: | ||
| # If we are loading replay, feedback, or logs+metrics, do not add the es5 modifier, as those | ||
| # bundles are ES6 only. | ||
| if is_v7_sdk and not has_replay and not has_feedback and not has_logs_and_metrics: |
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.
ES5 bundle incorrectly skipped for v7 SDK users
Medium Severity
The ES5 modifier condition incorrectly includes not has_logs_and_metrics. For v7 SDK users, logs+metrics bundles are never loaded (they require SDK >= 10.0.0), but if has_logs_and_metrics is True in the project settings, the ES5 modifier won't be added. This results in serving an ES6 bundle (bundle.min.js) instead of the required ES5 bundle (bundle.es5.min.js) for v7 SDK users, potentially causing compatibility issues in older browsers.
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.
| config["autoInjectFeedback"] = True | ||
|
|
||
| if loader_config["hasLogsAndMetrics"]: | ||
| config["enableLogs"] = True |
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.
enableLogs config set for unsupported SDK versions
Medium Severity
The enableLogs config option is set in the SDK init config whenever hasLogsAndMetrics is true, but this lacks the SDK version check that exists elsewhere. The bundle modifier .logs.metrics is correctly gated behind is_greater_or_equal_v10_sdk, but the config setting isn't. When SDK < 10.0.0, users will get enableLogs: True in their config while receiving a bundle that doesn't support the feature, creating an inconsistency.
Adds backend support for using the logs+metrics bundle in the JS loader
ref https://linear.app/getsentry/issue/JS-1465/support-logsmetrics-in-js-loader