-
-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sdk): Custom touch tracking property instead of accessibilityLabel #2712
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I've checked the code again and it looks good to me,
could you add a changelog (example below) so we can merge this?
### Breaking changes
(...)
- `touchEventBoundaryProps.labelName` property instead of default `accessibilityLabel` fallback ([#2712](https://github.com/getsentry/sentry-react-native/pull/2712))
@krystofwoldrich thanks for your review. I've added a changelog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Let's wait for CI and then it can be merged.
Thanks.
📢 Type of change
📜 Description
This PR removes the default usage of
accessibilityLabel
for automatic touch tracking due to GDPR issues. As a replacement, the PR adds a customlabelName
property to theTouchEventBoundary
that can be used to set a custom property name to be used for touch tracking.💡 Motivation and Context
Currently, the
sentry-react-native
usesaccessibilityLabel
for automatic touch tracking. This means that if nosentry-label
is provided it falls back to usingaccessibilityLabel
as part of the uploaded breadcrumbs. However,accessibilityLabel
often contains PII data that can help accessibility users with e.g. TalkBack or VoiceOver (this be for instance home address, phone number, social security number etc.). This means that whenever a touch event is logged to sentry.io for a component that has anaccessibilityLabel
and not asentry-label
the PII data will end up at Sentry. This is a GDPR issue for European companies.I think for a lot of users/companies it is not desirable (or even legal) to have their
accessibilityLabel
data logged by default. This PR adds a customlabelName
property to theTouchEventBoundary
that will then be used as fallback in case nosentry-label
is present. This can then be set to for instance"accessibilityLabel"
for users that would like to continue using theiraccessibilityLabel
in touch tracking, but it will then make sure that it is a conscious choice to log this as it will potentially hold PII data. In my own case, we would like to use our existingtestID
property for touch tracking (currently, we have an npm patch applied to Sentry that does exactly this because loggingaccessibilityLabel
is definitely not an option, an even though we could get around this by adding asentry-label
to all components that have anaccessibilityLabel
the default fallback is simply to dangerous for us in case we miss asentry-label
and anaccessibilityLabel
instead slips through), as it gives us a lot of context information about what interactions the app user performed up to a crash.I was motivated to create this PR by our support contacts from Sentry, Will C. and Hazid M.
💚 How did you test it?
I replaced the
accessibilityLabel
tests withcustom-sentry-label-name
and verified that clicking the "Capture Exception" button is logging the value stored incustom-sentry-label-name
in the Metro bundler in "Event beforeSend:" instead of the previously loggedaccessibilityLabel
.📝 Checklist
🔮 Next steps
This is a breaking change as
accessibilityLabel
will no longer be logged by default. The migration for existing users is to simply add it to yourtouchEventBoundaryProps.labelName
:or when using the component variant: