Repository navigation
feat(android): Add enableUserInteractionBreadcrumbs option - #7016
Open
GersonRocha9 wants to merge 2 commits into
Open
GersonRocha9 wants to merge 2 commits into
GersonRocha9 wants to merge 2 commits into
Conversation
Forward the option to sentry-java so an app can turn off native user interaction breadcrumbs on Android. When the option is false and native user interaction tracing is off (the default), UserInteractionIntegration does not wrap the activity Window.Callback. Closes getsentry#6993
GersonRocha9
requested review from
0xadam-brown,
alwx,
antonis,
itaybre,
philprime and
runningcode
and removed request for
a team
November 10, 2026 20:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
Adds the Android-only
enableUserInteractionBreadcrumbsoption and forwards it to sentry-java, in the same way as the breadcrumb off-switches from #6764 and #6768.RNSentryStart.javacallsoptions.setEnableUserInteractionBreadcrumbs(...)only when the key is present, so the native default (true) does not change.options.tshas the type with JSDoc (@default true,@platform android). The JSDoc says that the native breadcrumbs duplicate the JS touch breadcrumbs only when the app usesSentry.wrap, which addsTouchEventBoundary.Native user interaction tracing is
falseby default in sentry-java, and the React Native SDK does not turn it on. So when this option isfalse,UserInteractionIntegration.registerdoes not install the window callback.💡 Motivation and Context
Closes #6993
The native
UserInteractionIntegrationwraps theWindow.Callbackof each activity and does gesture detection on the main thread for every touch event. On low-end Android devices we saw ANRs with the blocked main-thread frame inside this callback. Before this change, the only way to turn the integration off from a React Native or Expo app was manifest meta-data.💚 How did you test it?
RNSentryStartTest.enableUserInteractionBreadcrumbsForwardedcheckstrue,false, and that the native default stays when the option is not set (./gradlew :RNSentry:testDebugUnitTest --tests 'io.sentry.react.RNSentryStartTest').wrapper.test.tschecks that the option reaches the native init parameters.yarn lint,yarn lint:androidandyarn api-report:checkpass locally.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Add the option to the React Native options page in sentry-docs.