Skip to content

test(replay): add iOS scroll mask leak reproducer - #771

Draft
dustinbyrne wants to merge 1 commit into
mainfrom
test/replay-scroll-mask-reproduction
Draft

test(replay): add iOS scroll mask leak reproducer#771
dustinbyrne wants to merge 1 commit into
mainfrom
test/replay-scroll-mask-reproduction

Conversation

@dustinbyrne

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Screenshot replay can mask a sensitive view at its current UIKit position while drawHierarchy returns pixels from an older scroll position. The result can expose pixels outside the mask during fast scrolling.

This draft adds an isolated reproduction to the example app. It uses synthetic red SECRET regions with the React Native-style ph-no-capture marker. The scroll view changes direction quickly and targets both overscroll edges.

The reproduction runs only when POSTHOG_REPLAY_MASK_REPRO=1. It reads test project settings from local launch variables. It does not change production SDK behavior or commit credentials.

A previous Cloud run with this fixture reproduced the leak in session 01a01645-1c5d-7c88-89d5-2da64e95b117. The expected result is that red pixels never appear in replay.

Run the reproduction

Use a local copy of the PostHogExample scheme. Do not commit the scheme or its credentials.

POSTHOG_REPLAY_MASK_REPRO=1
POSTHOG_TEST_PROJECT_TOKEN=<test project token>
POSTHOG_TEST_HOST=https://us.i.posthog.com
POSTHOG_TEST_RUN_ID=<unique run ID>

Run the app for at least one minute. Tap Flush. Find the replay by the test_run_id event property. Any visible red SECRET pixels show a mask leak.

💚 How did you test it?

  • Built and launched PostHogExample on the iOS 18.6 simulator.
  • Confirmed that the gate opens the automatic scrolling fixture.
  • Ran make test: 757 tests in 134 suites passed.
  • Ran make format, make lint, and git diff --check.
  • Confirmed that the diff contains no production SDK changes or test credentials.
  • Did not run a new Cloud upload after extracting the fixture into this branch.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

The human asked Pi to preserve the confirmed reproduction and open this draft PR. A Pi worker isolated the fixture behind an example-only launch gate. A fresh Pi reviewer checked the diff, the run instructions, the credential handling, and the match with the proven fixture. The human remained the DRI and discussed the reproduction design and prior results throughout the work.

@dustinbyrne dustinbyrne self-assigned this Aug 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@github-actions github-actions Bot added the stale label Aug 27, 2026
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.

1 participant