test(replay): add iOS scroll mask leak reproducer - #771
Draft
dustinbyrne wants to merge 1 commit into
Draft
Conversation
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 |
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
Screenshot replay can mask a sensitive view at its current UIKit position while
drawHierarchyreturns 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
SECRETregions with the React Native-styleph-no-capturemarker. 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
PostHogExamplescheme. Do not commit the scheme or its credentials.Run the app for at least one minute. Tap Flush. Find the replay by the
test_run_idevent property. Any visible redSECRETpixels show a mask leak.💚 How did you test it?
PostHogExampleon the iOS 18.6 simulator.make test: 757 tests in 134 suites passed.make format,make lint, andgit diff --check.📝 Checklist
If releasing new changes
pnpm changesetto 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.