Skip to content

feat: add breadcrumb text extraction option - #9010

Open
llirik0 wants to merge 6 commits into
getsentry:mainfrom
llirik0:feat/breadcrumb-text-extraction
Open

llirik0 wants to merge 6 commits into
getsentry:mainfrom
llirik0:feat/breadcrumb-text-extraction

Conversation

@llirik0

@llirik0 llirik0 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Add the dedicated experimental enableBreadcrumbTextExtraction privacy option requested in #8105.

  • Expose it as options.experimental.enableBreadcrumbTextExtraction on supported UIKit platforms.
  • Default it to false, so child-view text extraction is explicitly opt-in.
  • Expose the same experimental option through SentryObjCExperimentalOptions.
  • Snapshot the option in SentryBreadcrumbTracker when automatic breadcrumb tracking is installed.
  • Preserve the existing initReportAccessibilityIdentifier: selector and existing direct UIButton title behavior for compatibility.
  • Report opt-in adoption as breadcrumbTextExtraction through SentryEnabledFeaturesBuilder.

This PR intentionally does not copy child-view traversal from #8974. It establishes the dedicated configuration path first so #8974 can be rebased and gate only its final child-text fallback without coupling it to reportAccessibilityIdentifier.

Closes #8105

💡 Motivation and Context

Visible child text can contain user-provided or sensitive content. A separate experimental, disabled-by-default option keeps child-text extraction independent from the existing accessibility-identifier privacy setting and allows applications to prevent traversal before it is attempted.

💚 How did you test it?

Strict RED -> GREEN coverage verified:

  • The experimental Swift option exists and defaults to false.
  • Objective-C exposes the option through SentryObjCExperimentalOptions, defaults it to false, and retains assigned values.
  • Automatic breadcrumb tracking propagates both default-disabled and explicitly enabled values to the tracker.
  • Enabled-feature telemetry omits the disabled option and reports breadcrumbTextExtraction when enabled.
  • Existing tracker compatibility initialization remains covered, including visionOS.
  • Disabling child-text extraction does not remove the existing direct UIButton.currentTitle breadcrumb label.

Final verification:

  • make format
  • make lint-staged
  • make analyze
  • Standard iOS and macOS builds
  • V10 iOS and macOS builds
  • Full iOS suite: 5,783 tests / 128 skipped; 975 tests / 28 skipped; 85 tests / 5 skipped; zero failures
  • git diff --check

The full repository lint currently also reports two pre-existing violations in untouched CrashE2E files on main; all staged files pass lint. Public API snapshots were updated for standard and V10 SDKs. The canonical combined generator requires Xcode 16, which is unavailable locally under Xcode 26.3; snapshot ownership was structurally verified, and standard/V10 builds plus Swift and Objective-C API tests pass.

📝 Checklist

  • I added tests to verify the changes.
  • Child-text extraction is disabled by default and requires explicit opt-in.
  • I updated the docs if needed.
  • I updated the generated public API snapshots.
  • No breaking change for hybrid SDKs; the existing Objective-C initializer selector is preserved.
  • The new public option is exposed through SentryObjCExperimentalOptions.

llirik0 added a commit to llirik0/sentry-cocoa that referenced this pull request Sep 10, 2026

@NinjaLikesCheez NinjaLikesCheez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just pinged Phil on one question about the default value

Comment thread Sources/Swift/Options.swift Outdated
@NinjaLikesCheez NinjaLikesCheez added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Sep 11, 2026
llirik0 added a commit to llirik0/sentry-cocoa that referenced this pull request Sep 14, 2026
@llirik0
llirik0 force-pushed the feat/breadcrumb-text-extraction branch from ae3e5a8 to 179ef52 Compare September 14, 2026 02:58

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple of comments to consider.

Comment thread CHANGELOG.md
Comment thread Sources/Swift/Options.swift Outdated
Comment thread Sources/Swift/Options.swift Outdated
@llirik0
llirik0 force-pushed the feat/breadcrumb-text-extraction branch from c000e31 to 63d0283 Compare October 4, 2026 00:40
llirik0 added a commit to llirik0/sentry-cocoa that referenced this pull request Oct 7, 2026
@llirik0
llirik0 requested a review from philprime October 7, 2026 23:40
@llirik0
llirik0 requested a review from itaybre October 10, 2026 20:54

@philprime philprime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this work so far. Please see this comment on why the PR is currently considered as blocked:

#8974 (review)

@philprime philprime added Blocked and removed run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request Waiting for: Community labels Oct 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add enableBreadcrumbTextExtraction option on SentryOptions

4 participants