Skip to content

feat: enhance SentryUIRedactBuilder to support redaction of CALayer sublayers in iOS 26+#7781

Draft
itaybre wants to merge 2 commits intomainfrom
itay/session_replay_layer_based_redacting
Draft

feat: enhance SentryUIRedactBuilder to support redaction of CALayer sublayers in iOS 26+#7781
itaybre wants to merge 2 commits intomainfrom
itay/session_replay_layer_based_redacting

Conversation

@itaybre
Copy link
Copy Markdown
Contributor

@itaybre itaybre commented Apr 7, 2026

📜 Description

Add's SwiftUI layers for text and images to automatically redact content on iOS 26

💡 Motivation and Context

iOS 26 only uses layers for rendering SwiftUI content, thus our old logic broke and stopped masking text and images.

Fixes: #6390

💚 How did you test it?

Used our SwiftUI app with .sentryReplayPreviewMask(opacity: 0.5)

Example iOS 18 vs iOS 26
image

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Enhance SentryUIRedactBuilder to support redaction of CALayer sublayers in iOS 26+ by itaybre in #7781

Internal Changes 🔧

Deps

  • Bump mikepenz/action-junit-report from 6.3.1 to 6.4.0 by dependabot in #7773
  • Bump ruby/setup-ruby from 1.298.0 to 1.299.0 by dependabot in #7772
  • Bump fastlane-plugin-sentry from 2.5.0 to 2.5.1 by dependabot in #7771

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- enhance SentryUIRedactBuilder to support redaction of CALayer sublayers in iOS 26+ ([#7781](https://github.com/getsentry/sentry-cocoa/pull/7781))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 1844107

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
4545 2 4543 25
View the top 2 failed test(s) by shortest run time
SentryTests.SentryLayerRedactionTests::testRedact_layerOnlySublayer_producesRedactType_notRedactSwiftUI
Stack Traces | 0s run time
.../SentryTests/ViewCapture/SentryUIRedactBuilderTests+SwiftUI.swift:177 - XCTAssertEqual failed: ("0") is not equal to ("1") - Layer-only sublayers should produce .redact regions
SentryTests.SentryLayerRedactionTests::testRedact_layerOnlySublayer_shouldRedact
Stack Traces | 0s run time
.../SentryTests/ViewCapture/SentryUIRedactBuilderTests+SwiftUI.swift:112 - XCTAssertEqual failed: ("0") is not equal to ("1")

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix default masking of SwiftUI views in iOS 26 Liquid Glass

1 participant