feat(android): update session replay masking precedence rules#518
Open
feat(android): update session replay masking precedence rules#518
Conversation
| * signal applies. | ||
| */ | ||
| private fun resolveExplicit(target: MaskTarget, inherited: Boolean?, context: MaskContext): Boolean? { | ||
| val self = explicitOf(target, context) |
Contributor
There was a problem hiding this comment.
using self name is hard to understand, maybe ownExplicit ?
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.
Summary
Changes Android semantics to match iOS when applying session replay masking precedence rules.
This changes existing masking behavior, but should be clearer than the previous behavior. Please see the README changes for details.
How did you test this change?
Unit tests added.
Are there any deployment considerations?
N/A
Note
Medium Risk
Changes core session replay privacy behavior by redefining masking/unmasking precedence and propagation, which could alter what data is redacted in production replays if apps relied on the previous rules.
Overview
Aligns Android Session Replay masking behavior with a strict precedence model: explicit masks (including
maskXMLViewIds) propagate to descendants and override everything, explicit unmask propagates but cannot override an explicit mask, and global privacy matchers (e.g.maskTextInputs,maskText, view-class/webview/keyword heuristics) apply only to the matched node.Implements this by splitting
PrivacyProfilematchers intoexplicitMaskMatchersvsglobalMaskMatchers, updatingMaskCollector.collectMaskstraversal to carry inherited explicit state across native + Compose targets (including newhasLDUnmask), wiring the new matcher lists throughImageCaptureService, and adding unit tests plus README documentation to codify the new rules.Reviewed by Cursor Bugbot for commit 4973194. Bugbot is set up for automated code reviews on this repo. Configure here.