Repository navigation
fix(replay): drop touches inside explicitly masked views - #922
Conversation
There was a problem hiding this comment.
PostHog Review · Standard · reviewed c743db8: 2 Must fix, 1 Should fix.
This is the only automatic review while this pull request is a draft. Comment @posthog review to review new changes sooner. Otherwise, a review of the new changes runs when you mark it ready for review.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 2 · PR risk: 0/10 |
|
@PostHog review |
|
@ioannisj PostHog Review is reviewing this pull request. |
There was a problem hiding this comment.
PostHog Review · Standard · reviewed fe6c78e: 1 Must fix.
This is review round 3 on this pull request. When findings keep coming back in the same code, the approach is usually the problem. Before the next fix, check whether a different design would remove the whole class of findings.
…cated Brings in #922 (drop touches inside masked views) and #937 (no $feature_flag_called for survey targeting flags). Resolution: - PostHogReplayIntegration imports: union of both sides. - PostHogReplayIntegrationTest: keep main's MaskedTouchHarness tests and drop the three wireframe-mode tests, since 4.0 removes wireframe mode. - PostHogSurveysFlagEventTest: use the 2-argument getFeatureFlag, since 4.0 removes the defaultValue overload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The touch drop from #922 read the merged semantics tree, but the 4.0 mask walk reads the unmerged one. Inside a clickable parent, merging folds a postHogMask child into the parent node, so a tap on the masked child was recorded when the parent also held an unmasked sibling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
💡 Motivation and Context
Closes #907. iOS counterpart: PostHog/posthog-ios#995.
Session replay masks the pixels of
ph-no-captureviews andModifier.postHogMask()nodes, but still uploads the exact coordinates of every tap inside them, so a recording shows which key of a masked PIN pad was pressed. posthog-js drops interactions insideph-no-captureelements (packages/rrweb/rrweb/src/record/observer.ts:239); this does the same on Android.maskRule()classifier, including children of unclipped containers that draw outside them. Compose follows the same mask/unmask precedence.maskAllTextInputs/maskAllImagesare still recorded.Known gap, pre-existing and tracked separately: a
postHogMask()that merges under apostHogMask(false)parent is lost by the screenshot mask walk, so its touches aren't dropped either.💚 How did you test it?
postHogMask()(including a node drawn outside its parent), overflowing children, scrolled and translated views, a masked view that removes itself, gestures that end outside a mask,maskAllTextInputs, and an unmasked control. Each fails without its fix.PostHogReplayTouchWithoutComposeTestruns intestWithoutCompose, so touches keep working with Compose off the classpath.mainevery masked tap was uploaded with exact coordinates; on this branch only the unmasked tap was. That ran on 7d5b4e7, before the later fixes.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
DRI: @ioannisj
Autonomy: Human-driven (agent-assisted)