You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Callback error isolation: align beforeBreadcrumb / tracesSampler fallbacks with the SDK spec #6668
RN already wraps user callbacks (safeFactory / safeTracesSampler in packages/core/src/js/utils/safe.ts, applied in sdk.tsx) and logs via debug.error, does not re-throw, and does not self-capture — so the error-log / no-rethrow / no-capture requirements are met. Two recovery values deviate from the spec's fallback matrix:
safe.ts:50 returns 0 on failure. The spec says fall back to traces_sample_rate and MUST NOT substitute 0.0/1.0. Silently dropping all transactions on a sampler bug is exactly the substitution the spec forbids.
→ Fall back to the configured tracesSampleRate instead.
2. beforeBreadcrumb throw → keeps the original breadcrumb
safeFactory returns args[0] on failure (safe.ts:29), so a throwing beforeBreadcrumbkeeps the unmodified breadcrumb. The spec says drop the breadcrumb (client report None).
→ Return null on failure for the breadcrumb case.
Not in scope / not RN-specific
beforeSend, beforeSendTransaction, beforeSendSpan, beforeSendLog, and event processors are handled by the @sentry/core pipeline (_processEvent), not by RN — including the new callback_error client-report reason. Any gap there belongs to @sentry/javascript.
profilesSampler / error_sampler don't exist in RN (only profilesSampleRate), so those rows don't apply.
initialScope, integrations, and withScope get extra RN-side isolation not in the core matrix — reasonable, left as-is.
Caveat
The spec is still candidate and in active review (PR #19189 has open proposals to narrow isolation to "recoverable" errors and to drop before_send_metric). Neither affects the two items above.
Activity
linear-code commentedon Sep 3, 2026
RN-759
fix(core): Align beforeBreadcrumb and tracesSampler error fallbacks w…
github-actions commentedon Sep 10, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #6675, which was included in the 8.26.0 release.