Skip to content

ref(browser): Set more descriptive mechanism.type in browserApiErrorsIntergation #17251

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 31, 2025

type now follows the trace origin naming scheme. Omitted data.function in favour of more specific types.

see #17212
closes #17250

@Lms24 Lms24 self-assigned this Jul 31, 2025
@@ -133,6 +133,7 @@ export function wrap<T extends WrappableFunction, NonFunction>(
return event;
});

// no need to add a mechanism here, we already add it via an event processor above
Copy link
Member Author

@Lms24 Lms24 Jul 31, 2025

Choose a reason for hiding this comment

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

wrap is only called by browserApiErrors, where I changed type below.

Copy link
Contributor

github-actions bot commented Jul 31, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.78 kB +0.08% +17 B 🔺
@sentry/browser - with treeshaking flags 22.37 kB +0.12% +25 B 🔺
@sentry/browser (incl. Tracing) 39.45 kB +0.06% +22 B 🔺
@sentry/browser (incl. Tracing, Replay) 77.53 kB +0.03% +17 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.4 kB +0.02% +13 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 82.23 kB +0.03% +19 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 94.37 kB +0.02% +15 B 🔺
@sentry/browser (incl. Feedback) 40.47 kB +0.06% +22 B 🔺
@sentry/browser (incl. sendFeedback) 28.46 kB +0.07% +18 B 🔺
@sentry/browser (incl. FeedbackAsync) 33.36 kB +0.07% +22 B 🔺
@sentry/react 25.52 kB +0.07% +17 B 🔺
@sentry/react (incl. Tracing) 41.41 kB +0.04% +14 B 🔺
@sentry/vue 28.22 kB +0.07% +19 B 🔺
@sentry/vue (incl. Tracing) 41.25 kB +0.04% +15 B 🔺
@sentry/svelte 23.81 kB +0.09% +20 B 🔺
CDN Bundle 25.3 kB +0.08% +19 B 🔺
CDN Bundle (incl. Tracing) 39.33 kB +0.06% +23 B 🔺
CDN Bundle (incl. Tracing, Replay) 75.4 kB +0.02% +14 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 80.84 kB +0.03% +19 B 🔺
CDN Bundle - uncompressed 73.91 kB +0.07% +47 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 116.39 kB +0.05% +47 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 230.61 kB +0.03% +47 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.42 kB +0.02% +47 B 🔺
@sentry/nextjs (client) 43.48 kB +0.05% +19 B 🔺
@sentry/sveltekit (client) 39.88 kB +0.05% +19 B 🔺
@sentry/node-core 47.53 kB - -
@sentry/node 146.19 kB - -
@sentry/node - without tracing 91.63 kB - -
@sentry/aws-serverless 103.08 kB - -

View base workflow run

@Lms24 Lms24 mentioned this pull request Jul 31, 2025
3 tasks
@Lms24 Lms24 marked this pull request as ready for review July 31, 2025 11:20
@@ -15,11 +15,8 @@ sentryTest(
type: 'Error',
value: 'xhr_error',
mechanism: {
type: 'instrument',
type: 'auto.browser.browserapierrors.xhr.onreadystatechange',
Copy link

Choose a reason for hiding this comment

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

Bug: Test Expectation Mismatch with Exception Data

The test expects the exception mechanism to omit the data field, but the _wrapXHR implementation still includes data: { handler: getFunctionName(original) }. The test expectation should be updated to match this, expecting data: { handler: expect.any(String) }.

Fix in Cursor Fix in Web

@Lms24 Lms24 requested review from AbhiPrasad and andreiborza August 1, 2025 13:37
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.

Adjust mechanism in browser SDK
1 participant