Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
});
```
- Add the `enableUserInteractionBreadcrumbs` option to turn off native user interaction breadcrumbs on Android ([#7016](https://github.com/getsentry/sentry-react-native/pull/7016))

### Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ static void getSentryAndroidOptions(
options.setEnableAppComponentBreadcrumbs(
rnOptions.getBoolean("enableAppComponentBreadcrumbs"));
}
if (rnOptions.hasKey("enableUserInteractionBreadcrumbs")) {
options.setEnableUserInteractionBreadcrumbs(
rnOptions.getBoolean("enableUserInteractionBreadcrumbs"));
}
if (rnOptions.hasKey("spotlight")) {
if (rnOptions.getType("spotlight") == ReadableType.Boolean) {
options.setEnableSpotlight(rnOptions.getBoolean("spotlight"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,11 @@ public void enableAppComponentBreadcrumbsForwarded() {
assertBreadcrumbOffSwitchForwarded(
"enableAppComponentBreadcrumbs", SentryAndroidOptions::isEnableAppComponentBreadcrumbs);
}

@Test
public void enableUserInteractionBreadcrumbsForwarded() {
assertBreadcrumbOffSwitchForwarded(
"enableUserInteractionBreadcrumbs",
SentryAndroidOptions::isEnableUserInteractionBreadcrumbs);
}
}
1 change: 1 addition & 0 deletions packages/core/etc/sentry-react-native.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export interface BaseReactNativeOptions {
enableTombstone?: boolean;
// @internal
enableTurboModuleTracking?: boolean;
enableUserInteractionBreadcrumbs?: boolean;
enableUserInteractionTracing?: boolean;
enableWatchdogTerminationTracking?: boolean;
// Warning: (ae-forgotten-export) The symbol "SharedExperimentsSubset" needs to be exported by the entry point index.d.ts
Expand Down
17 changes: 17 additions & 0 deletions packages/core/src/js/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,23 @@ export interface BaseReactNativeOptions {
*/
enableAppComponentBreadcrumbs?: boolean;

/**
* When enabled, the native Android SDK records breadcrumbs for user interactions
* (taps, swipes and scrolls) by wrapping each activity's `Window.Callback`.
*
* When the app uses `Sentry.wrap`, which adds `TouchEventBoundary`, the JS SDK already
* records touch breadcrumbs, so the native breadcrumbs duplicate them. Without
* `Sentry.wrap`, the native breadcrumbs are the only user interaction breadcrumbs.
*
* Disable this to stop the native layer from wrapping the window callback and adding
* user interaction breadcrumbs. If native user interaction tracing is also disabled
* (the default), the native `UserInteractionIntegration` is not installed.
*
* @default true
* @platform android
*/
enableUserInteractionBreadcrumbs?: boolean;

/**
* Use this feature to enable the Sentry MetricKit integration.
*
Expand Down
2 changes: 2 additions & 0 deletions packages/core/test/wrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ describe('Tests Native Wrapper', () => {
enableAppLifecycleBreadcrumbs: false,
enableSystemEventBreadcrumbs: false,
enableAppComponentBreadcrumbs: false,
enableUserInteractionBreadcrumbs: false,
devServerUrl: undefined,
defaultSidecarUrl: undefined,
mobileReplayOptions: undefined,
Expand All @@ -278,6 +279,7 @@ describe('Tests Native Wrapper', () => {
expect(initParameter.enableAppLifecycleBreadcrumbs).toBe(false);
expect(initParameter.enableSystemEventBreadcrumbs).toBe(false);
expect(initParameter.enableAppComponentBreadcrumbs).toBe(false);
expect(initParameter.enableUserInteractionBreadcrumbs).toBe(false);
});

test('forwards reportAccessibilityIdentifier to the Native SDK', async () => {
Expand Down
Loading