Repository navigation
fix(replay): mask content drawn outside a view's bounds - #1000
Merged
Merged
Conversation
Backport of #976 to 3.x. Screenshot masks only covered each masked view's bounds, so unclipped images, layer shadows, overflowing button titles and subviews of masked text stayed visible. Image attachments in text are masked when maskAllImages is on, in the screenshot walk only so wireframe text is unchanged.
Contributor
posthog-ios Compliance ReportDate: 2026-10-30T16:31:03.355172+00:00
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 3323ms |
| Format Validation.Event Has Uuid | ✅ | 2843ms |
| Format Validation.Event Has Lib Properties | ✅ | 596ms |
| Format Validation.Distinct Id Is String | ✅ | 441ms |
| Format Validation.Token Is Present | ✅ | 2795ms |
| Format Validation.Custom Properties Preserved | ✅ | 2768ms |
| Format Validation.Event Has Timestamp | ✅ | 2913ms |
| Format Validation.Non Utc Event Timestamp Is Converted To Utc | ✅ | 279ms |
| Retry Behavior.Retries On 503 | ✅ | 11700ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 2430ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 4639ms |
| Retry Behavior.Respects Retry After Header | ✅ | 7741ms |
| Retry Behavior.Implements Backoff | ✅ | 21436ms |
| Retry Behavior.Retries On 500 | ✅ | 9239ms |
| Retry Behavior.Retries On 502 | ✅ | 9346ms |
| Retry Behavior.Retries On 504 | ✅ | 5421ms |
| Retry Behavior.Max Retries Respected | ❌ | 21794ms |
| Deduplication.Generates Unique Uuids | ✅ | 2986ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 9318ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 10458ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 7815ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 2994ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 3266ms |
| Compression.Sends Gzip When Enabled | ✅ | 295ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 2791ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 319ms |
| Batch Format.Multiple Events Batched Together | ✅ | 2996ms |
| Error Handling.Does Not Retry On 403 | ✅ | 4745ms |
| Error Handling.Does Not Retry On 413 | ✅ | 4820ms |
| Error Handling.Retries On 408 | ✅ | 9257ms |
Failures
retry_behavior.max_retries_respected
Expected 4 requests, got 6
Feature_Flags Tests
✅ 17/17 tests passed
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ✅ | 2827ms |
| Request Payload.Flags Request Uses V2 Query Param | ✅ | 2707ms |
| Request Payload.Flags Request Hits Flags Path Not Decide | ✅ | 2789ms |
| Request Payload.Flags Request Omits Authorization Header | ✅ | 2803ms |
| Request Payload.Token In Flags Body Matches Init | ✅ | 2966ms |
| Request Payload.Groups Round Trip | ✅ | 2909ms |
| Request Payload.Groups Default To Empty Object | ✅ | 3370ms |
| Request Payload.Disable Geoip False Propagates As Geoip Disable False | ✅ | 3156ms |
| Request Payload.Disable Geoip Omitted Defaults To False | ✅ | 2840ms |
| Request Payload.Flag Keys To Evaluate Contains Only Requested Key | ✅ | 2854ms |
| Request Lifecycle.No Flags Request On Init Alone | ✅ | 89ms |
| Request Lifecycle.No Flags Request On Normal Capture | ✅ | 2795ms |
| Request Lifecycle.Two Flag Calls Produce Two Remote Requests | ✅ | 5598ms |
| Request Lifecycle.Mock Response Value Is Returned To Caller | ✅ | 2841ms |
| Retry Behavior.Retries Flags On 502 | ✅ | 2838ms |
| Retry Behavior.Retries Flags On 504 | ✅ | 2896ms |
| Side Effect Events.Get Feature Flag Captures Feature Flag Called Event | ✅ | 3145ms |
dustinbyrne
approved these changes
Oct 30, 2026
dustinbyrne
left a comment
Contributor
There was a problem hiding this comment.
No actionable issues found in this 3.x screenshot-masking backport. The changes preserve wireframe behavior and the public API.
AI-assisted review.
turnipdabeets
added a commit
that referenced
this pull request
Nov 10, 2026
…line-masking Brings in #911's current head, which includes main. Conflict resolutions: - Portals: take #911's model (the portal and, for one shown elsewhere, its rect; the whole portal is masked unless the source is clean). The whole-portal and unsettled-source regions are tagged .rectOnly. wholePortals and hasInPlaceCopy are removed: the walk already masks the whole portal whenever a mask sits under or over its source. - GPU capture: mirrorAndMask gains a .fallback case for #911's culled full-window cover, checked before inline masking; maskableRects/GPUMaskWalk stay for the plain walk, sharing the cover check. - postHogMask reporters keep #911's region(of:) (collapsed reporters with a model size) with an explicit inline tag: .extent on the main walk, .rectOnly through a portal. - MaskedRegion's view and layer initializers keep #1000's drawn outsets with an explicit .owned tag. - contentsKeys stays internal for inline masking and gains #911's contentsTransformKey. - GPU capture tests take #911's FrameOutcome-based expectNoUnmaskedMagenta, with noCaptureView from GPUCaptureTestSupport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xLynxqQ97w5iqqo4Dxyi5
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.
💡 Motivation and Context
Backports #976 to 3.x, as @ioannisj suggested on that PR. Apps with
screenshotModeon have the same leak: masks only covered each masked view's bounds, so anything a view drew past them was uploaded.Now masked:
ph-no-captureonesmaskAllImagesis on (symbols and asset-catalog images stay visible)Differences from #976:
isLabelSensitiveandisTextViewSensitiveto star out text. The attachment check is in the screenshot mask walk instead of those helpers, so wireframe text isn't masked because of an attachment.type_body_lengtherror.As in #976, masks aren't clipped to a clipping ancestor, so an overflowing image in a clipping cell can get a mask that spills into neighbouring cells. That fails closed.
💚 How did you test it?
The tests from #976 in
PostHogMaskFailClosedTestcame across unchanged. Local runs on Xcode 26.4.1, iPhone 17 Pro simulator:make lint: passes.make buildSdk: passes. It ran before the helper moved to the extension; after the move I re-ran lint and the iOS masking suite.make testOniOSSimulator: passes. It also ran before the move.PostHogMaskFailClosedTestafter the move: 27 tests pass.make test(macOS, where this code is compiled out): 2 app-group storage tests fail (excludes new and existing project folders from backup,writes to disk in a project token folder under a group container directory). I didn't re-run these on unmodified main; fix(replay): mask content drawn outside a view's bounds #976 saw the same backup-exclusion failure on its unmodified base.make maskSnapshotsandmake testPresentationMasks, because the pinned snapshot toolchain isn't installed here. There's no automated test that wireframe text stays the same, sincetoWireframeis private.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Built with Claude Code (Claude Opus 5.5) by applying the squash commit from #976 to
main. The only conflict was a doc comment inUIView+Util.swift, where I kept main's wireframe note. The wireframe and lint differences above came up during the backport.🤖 Generated with Claude Code