dd-sdk-ios
dd-sdk-ios copied to clipboard
RUM-6284 Implement Overrides Logic
What and why?
This PR builds on the work from #2058, which introduced Fine-Grained Masking (FGM) overrides (see the RFC [internal] for more details). It implements the logic for applying the text and input privacy override, as well as image privacy override, at the view level. The goal is to allow views to have a specific privacy setting that overrides the global configuration.
Additionally, it ensures that privacy overrides propagate to child views, allowing parents to enforce privacy settings for their entire subtree, unless explicitly overridden by child views.
How?
- Updated recorders that handle text and user inputs, as well as images (e.g.,
UILabelRecorder,UIPickerViewRecorder,UIImageViewRecorder) to incorporate privacy overrides logic. - Modified these recorders to take into account the view's attributes in addition the context to determine the appropriate behavior.
- Implemented logic to resolve the effective privacy level at each view, ensuring that:
- view-level overrides take precedence over global settings
- child views inherit privacy settings from their parent, unless explicitly set their own overrides
- Renamed
SessionReplayOverrideExtensiontoSessionReplayOverridesto improve clarity
Review checklist
- [x] Feature or bugfix MUST have appropriate tests (unit, integration)
- [x] Make sure each commit and the PR mention the Issue number or JIRA reference
- [ ] Add CHANGELOG entry for user facing changes
Datadog Report
Branch report: RUM-6284-implement-text-override-logic
Commit report: cd68082
Test service: dd-sdk-ios
:white_check_mark: 0 Failed, 3507 Passed, 0 Skipped, 2m 18.97s Total Time :small_red_triangle_down: Test Sessions change in coverage: 2 decreased, 5 increased, 7 no change
:small_red_triangle_down: Code Coverage Decreases vs Default Branch (2)
question/ Do we have an existing plan for adding coverage through snapshot tests? I think the FGM can vastly benefit from that level of integration testing, given the broad impact of this feature.
Yes, that's a good point! It's on my mind since the beginning. I'm planning to tackle this in a separate PR, once all the work on the logic itself is completed.