Problem Statement
When Session Replay masking is active (maskAllText: true, the default), the SDK skips all sentry-label props to prevent leaking masked text content into breadcrumbs. However, this also silently ignores manually set sentry-label props that developers use for component tracking — these are developer-provided identifiers (like "checkout-button"), not user-visible text, and should not be affected by masking.
The SDK cannot distinguish between the two at runtime because both are just sentry-label string props.
Proposed Solution
Use a different prop name for auto-injected labels in the Babel plugin (e.g., data-sentry-label), and update the SDK to handle them separately:
sentry-label (manual) — always read, never skipped by masking
data-sentry-label (auto-injected) — skipped when maskAllText is enabled or inside a Sentry.Mask boundary
This requires a coordinated change in:
@sentry/babel-plugin-component-annotate — inject as data-sentry-label instead of sentry-label
@sentry/react-native — update getLabelValue() in touchevents.tsx to read both props with different masking behavior
Context
Part of the "Making breadcrumbs data more useful" project. The masking behavior was introduced in #6142, and the auto-injection in #6141.
Problem Statement
When Session Replay masking is active (
maskAllText: true, the default), the SDK skips allsentry-labelprops to prevent leaking masked text content into breadcrumbs. However, this also silently ignores manually setsentry-labelprops that developers use for component tracking — these are developer-provided identifiers (like"checkout-button"), not user-visible text, and should not be affected by masking.The SDK cannot distinguish between the two at runtime because both are just
sentry-labelstring props.Proposed Solution
Use a different prop name for auto-injected labels in the Babel plugin (e.g.,
data-sentry-label), and update the SDK to handle them separately:sentry-label(manual) — always read, never skipped by maskingdata-sentry-label(auto-injected) — skipped whenmaskAllTextis enabled or inside aSentry.MaskboundaryThis requires a coordinated change in:
@sentry/babel-plugin-component-annotate— inject asdata-sentry-labelinstead ofsentry-label@sentry/react-native— updategetLabelValue()intouchevents.tsxto read both props with different masking behaviorContext
Part of the "Making breadcrumbs data more useful" project. The masking behavior was introduced in #6142, and the auto-injection in #6141.