Uh oh!
There was an error while loading. Please reload this page.
feat(core): Isolate throwing user callbacks instead of capturing them as events - #23770
feat(core): Isolate throwing user callbacks instead of capturing them as events#23770msonnb wants to merge 3 commits into
Conversation
msonnb
commented
Aug 31, 2026
bugbot run |
size-limit report 📦
|
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 5336fc6. Configure here.
5336fc6 to
4fb6808Compare…m as events Wraps `beforeSend`, `beforeSendTransaction`, event processors, `tracesSampler`, `beforeBreadcrumb`, `beforeSendLog` and `beforeSendMetric` in `safeCallback`. A throwing or rejecting callback now drops the event/breadcrumb/log/metric (with a client report where one exists) instead of escaping into the calling code or being captured as an `internal` error event. `tracesSampler` falls back to the parent sampling decision, then `tracesSampleRate`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4fb6808 to
ecd1b12Compare| transport: loggingTransport, | ||
| }); | ||
| Sentry.addEventProcessor(() => { |
There was a problem hiding this comment.
this could also have a second scenario where we throw in an async event processor?
mydea
left a comment
There was a problem hiding this comment.
overall seems good to me 👍 I wonder if the DEBUG_BUILD flags are worth it, looking at the bundle size (it makes up 50b...), omitting this may actually cut down a tiny but of bundle size for non-tree-shaken builds, but no strong feeling.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
msonnb
commented
Sep 2, 2026
@mydea hm yes i agree that 50B doesn't seem like a lot. when we add more of these to integrations though, it might end up adding up to a bit more, so I'd slightly lean towards keeping them. |
There was a problem hiding this comment.
l: can we add a test what happens when we set tracesSampleRate: 1 that shows that the span is sent in this case?
…Rate fallback Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wraps
beforeSend,beforeSendTransaction, event processors,tracesSampler,beforeBreadcrumb,beforeSendLogandbeforeSendMetricin thesafeCallbackhelper from #23760. A throwing or rejecting callback no longer escapes into the calling code and is no longer captured as aninternalerror event; the event/breadcrumb/log/metric is dropped, a client report is recorded where a category exists, and the error is logged in debug mode.part of #23755