Skip to content

beforeBreadcrumb isn't working #5284

@Niryo

Description

@Niryo

What React Native libraries do you use?

React Native Navigation by Wix

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

5.35.0

How does your development environment look like?

react native 77

Sentry.init()

require('@sentry/react-native').init({
dsn,
enableNdkScopeSync: true,
environment: this.getEnvironment(),
enableAutoSessionTracking: true,
autoInitializeNativeSdk: false,
tracesSampleRate: 0.3,
beforeSend: this.beforeSend.bind(this),
beforeBreadcrumb(breadcrumb) {
return null;
};
integrations: this.getIntegrations(),
tracePropagationTargets: ['localhost', /^//, /^https:///],
});

private getIntegrations() {
const Navigation = require('react-native-navigation').Navigation;
const Sentry = require('@sentry/react-native');
const extraErrorData = extraErrorDataIntegration();
return [
extraErrorData,
new Sentry.reactNativeTracingIntegration({
routingInstrumentation: new ReactNativeNavigationInstrumentation(
Navigation,
),
shouldCreateSpanForRequest: (url: string) => {
// Do not create spans for outgoing requests for frog.wix.com
return !url.match(/https://frog.wix.com.*/);
},
}),
];
}

Steps to Reproduce

it could be an issue on our side, so i am not sure that it will easily reproduce on a clean state, but anyways, i think it could be an issue with initializing the sdk on the native side + trying to use beforeBreadcrumbs. in our case, no matter what i put in beforeBreadcrumbs, i still see all the breadCrumbs being sent.
i am not sure how to debug it.

Expected Result

beforeBreadcrumbs should work

Actual Result

before breadcrumbs is completely ignored

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions