Skip to content

Conversation

@abelonogov-ld
Copy link
Contributor

@abelonogov-ld abelonogov-ld commented Nov 13, 2025

  • ldIgnore() method to turn off masking for a whole tree
  • fix issue when ldUnmask() could make view untappable in SwiftUI
  • fix unmaskAccessibilityIdentifiers

Note

Adds ldIgnore and explicit unmask controls (including Obj-C bridge), extends privacy options, and updates the mask collector to honor new ignore/unmask rules; demo app applies ldIgnore and updates identifiers.

  • API:
    • Add ldIgnore() for SwiftUI and UIView, plus ldMask() convenience.
    • Introduce Obj-C bridge ObjcLDMasking with maskView:, unmaskView:, ignoreView:.
    • Update SessionReplayModifier to support optional isEnabled and isIgnored.
  • Privacy Options:
    • Extend SessionReplayOptions.PrivacyOptions with unmaskUIViews, unmaskAccessibilityIdentifiers, and ignoreUIViews.
  • Masking Engine:
    • MaskCollector.Settings now tracks maskUIViews, unmaskUIViews, ignoreUIViews, and corresponding accessibility identifiers.
    • Add shouldIgnore and update shouldMask to respect explicit unmask/ignore via associated objects, class lists, and accessibility identifiers.
    • Skip ignored views during collection and fall back to associated shouldMaskUIView when applicable.
  • Demo App:
    • Apply .ldIgnore() to smoothie list rows; add "10" to masked accessibility identifiers.

Written by Cursor Bugbot for commit c6c149d. This will update automatically on new commits. Configure here.

* main:
  chore: prepare folders for binaryframework (#79)
  refactor: get sampling config graphql to poso (#78)
  feat: refactor instrumentation options (#77)
  feat: options refactor (#75)
@abelonogov-ld abelonogov-ld changed the title feat: ignore masking WIP feat: ignore masking Nov 13, 2025
@abelonogov-ld abelonogov-ld changed the title WIP feat: ignore masking feat: ignore masking Nov 13, 2025


func shouldIgnore(_ view: UIView) -> Bool {
let viewType = type(of: view)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a little bit expensive cpu-wise, just a notice, since you are now relying on ObjectIdentifier as the main approach to identify the views, it is not a good idea to change the approch this time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use ObjectIdentifier from the type not from the instance. That's why I need viewType

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, just a small notice, not asking for a change, we are good

return true
}

if SessionReplayAssociatedObjects.shouldMaskUIView(view) ?? false {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return SessionReplayAssociatedObjects.shouldMaskUIView(view) == true

let effectiveFrame = rPresenation.convert(layer.frame, from: layer.superlayer)

let shouldIgnore = settings.shouldIgnore(view)
guard !shouldIgnore else { return }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better, if you don't need the result from settings.shouldIgnore(view) down below
guard !settings.shouldIgnore(view) else { return }

// let corner0 = CGPoint.zero
// let corner1 = CGPoint(x: lBounds.width, y: 0)

// let corner0 = CGPoint.zero
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete commented-out code

…-launchdarkly-observability into andrey/ignore-masking

* 'andrey/ignore-masking' of github.com:launchdarkly/swift-launchdarkly-observability:
@objcMembers
public class ObjcLDMasking: NSObject {
// Use explicit selectors so we control the Obj-C names.
@objc(maskView:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are using @objcMembers annotation this is redundant, remove it please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already but it also not as it assigns the name exported method

view.ldMask()
}

@objc(unmaskView:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are using @objcMembers annotation this is redundant, remove it please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use for naming as well

view.ldUnmask()
}

@objc(ignoreView:)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are using @objcMembers annotation this is redundant, remove it please

// let corner1 = CGPoint(x: lBounds.width, y: 0)

} else {
// TODO: finish 3D animations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove else if you are not implementing/handling this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will

@abelonogov-ld abelonogov-ld merged commit 1372064 into main Nov 15, 2025
5 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/ignore-masking branch November 15, 2025 00:29
abelonogov-ld added a commit that referenced this pull request Nov 15, 2025
abelonogov-ld pushed a commit that referenced this pull request Nov 15, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](0.9.2...0.10.0)
(2025-11-15)


### Features

* ignore masking
([#80](#80))
([1372064](1372064))
* options refactor
([#75](#75))
([b442cbc](b442cbc))
* refactor instrumentation options
([#77](#77))
([ebc2e24](ebc2e24))


### Bug Fixes

* touch throttle
([#81](#81))
([6d1cd15](6d1cd15))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Bumps SDK to 0.10.0 and updates the changelog with new features and a
bug fix.
> 
> - **Release**: bump version to `0.10.0`
>   - Update `.` version in `.release-please-manifest.json`
> - Update `sdkVersion` in
`Sources/LaunchDarklyObservability/Version.swift`
> - **Docs**: refresh `CHANGELOG.md` with features (ignore masking,
options refactor, instrumentation options refactor) and a bug fix (touch
throttle)
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1bf72a3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants