From 4ef2dc30bfae57c8966ca5f7aa1ef956f0349dae Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Mon, 2 Feb 2026 13:36:39 +0100 Subject: [PATCH 1/6] feat(replay): Track custom masking usage via fake integration --- .../java/io/sentry/SentryReplayOptions.java | 25 +++++-- .../java/io/sentry/SentryReplayOptionsTest.kt | 70 +++++++++++++++++++ 2 files changed, 88 insertions(+), 7 deletions(-) diff --git a/sentry/src/main/java/io/sentry/SentryReplayOptions.java b/sentry/src/main/java/io/sentry/SentryReplayOptions.java index 367b150c92..638c25e9d0 100644 --- a/sentry/src/main/java/io/sentry/SentryReplayOptions.java +++ b/sentry/src/main/java/io/sentry/SentryReplayOptions.java @@ -1,5 +1,7 @@ package io.sentry; +import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion; + import io.sentry.protocol.SdkVersion; import io.sentry.util.SampleRateUtils; import java.util.ArrayList; @@ -16,6 +18,8 @@ public final class SentryReplayOptions { + private static final String CUSTOM_MASKING_INTEGRATION_NAME = "ReplayCustomMasking"; + public static final String TEXT_VIEW_CLASS_NAME = "android.widget.TextView"; public static final String IMAGE_VIEW_CLASS_NAME = "android.widget.ImageView"; public static final String WEB_VIEW_CLASS_NAME = "android.webkit.WebView"; @@ -209,8 +213,9 @@ public enum SentryReplayQuality { public SentryReplayOptions(final boolean empty, final @Nullable SdkVersion sdkVersion) { if (!empty) { - setMaskAllText(true); - setMaskAllImages(true); + // Add default mask classes directly without setting usingCustomMasking flag + maskViewClasses.add(TEXT_VIEW_CLASS_NAME); + maskViewClasses.add(IMAGE_VIEW_CLASS_NAME); maskViewClasses.add(WEB_VIEW_CLASS_NAME); maskViewClasses.add(VIDEO_VIEW_CLASS_NAME); maskViewClasses.add(ANDROIDX_MEDIA_VIEW_CLASS_NAME); @@ -275,11 +280,12 @@ public void setSessionSampleRate(final @Nullable Double sessionSampleRate) { *

Default is enabled. */ public void setMaskAllText(final boolean maskAllText) { + addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); if (maskAllText) { - addMaskViewClass(TEXT_VIEW_CLASS_NAME); + maskViewClasses.add(TEXT_VIEW_CLASS_NAME); unmaskViewClasses.remove(TEXT_VIEW_CLASS_NAME); } else { - addUnmaskViewClass(TEXT_VIEW_CLASS_NAME); + unmaskViewClasses.add(TEXT_VIEW_CLASS_NAME); maskViewClasses.remove(TEXT_VIEW_CLASS_NAME); } } @@ -293,11 +299,12 @@ public void setMaskAllText(final boolean maskAllText) { *

Default is enabled. */ public void setMaskAllImages(final boolean maskAllImages) { + addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); if (maskAllImages) { - addMaskViewClass(IMAGE_VIEW_CLASS_NAME); + maskViewClasses.add(IMAGE_VIEW_CLASS_NAME); unmaskViewClasses.remove(IMAGE_VIEW_CLASS_NAME); } else { - addUnmaskViewClass(IMAGE_VIEW_CLASS_NAME); + unmaskViewClasses.add(IMAGE_VIEW_CLASS_NAME); maskViewClasses.remove(IMAGE_VIEW_CLASS_NAME); } } @@ -308,6 +315,7 @@ public Set getMaskViewClasses() { } public void addMaskViewClass(final @NotNull String className) { + addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); this.maskViewClasses.add(className); } @@ -317,6 +325,7 @@ public Set getUnmaskViewClasses() { } public void addUnmaskViewClass(final @NotNull String className) { + addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); this.unmaskViewClasses.add(className); } @@ -351,12 +360,14 @@ public long getSessionDuration() { @ApiStatus.Internal public void setMaskViewContainerClass(@NotNull String containerClass) { - addMaskViewClass(containerClass); + addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); + maskViewClasses.add(containerClass); maskViewContainerClass = containerClass; } @ApiStatus.Internal public void setUnmaskViewContainerClass(@NotNull String containerClass) { + addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); unmaskViewContainerClass = containerClass; } diff --git a/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt b/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt index cf96bd5d7d..c68bf4ac21 100644 --- a/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt +++ b/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt @@ -1,10 +1,18 @@ package io.sentry +import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertFalse import kotlin.test.assertTrue class SentryReplayOptionsTest { + + @BeforeTest + fun setup() { + SentryIntegrationPackageStorage.getInstance().clearStorage() + } + @Test fun `uses medium quality as default`() { val replayOptions = SentryReplayOptions(true, null) @@ -126,4 +134,66 @@ class SentryReplayOptionsTest { assertTrue(headers.contains("X-Response-Header")) assertTrue(headers.contains("X-Debug-Header")) } + + // Custom Masking Integration Tests + + private fun hasCustomMaskingIntegration(): Boolean { + return SentryIntegrationPackageStorage.getInstance() + .integrations + .contains("ReplayCustomMasking") + } + + @Test + fun `default options does not add ReplayCustomMasking integration`() { + SentryReplayOptions(false, null) + assertFalse(hasCustomMaskingIntegration()) + } + + @Test + fun `empty options does not add ReplayCustomMasking integration`() { + SentryReplayOptions(true, null) + assertFalse(hasCustomMaskingIntegration()) + } + + @Test + fun `addUnmaskViewClass adds ReplayCustomMasking integration`() { + val options = SentryReplayOptions(false, null) + options.addUnmaskViewClass("com.example.MyTextView") + assertTrue(hasCustomMaskingIntegration()) + } + + @Test + fun `setMaskViewContainerClass adds ReplayCustomMasking integration`() { + val options = SentryReplayOptions(false, null) + options.setMaskViewContainerClass("com.example.MyContainer") + assertTrue(hasCustomMaskingIntegration()) + } + + @Test + fun `setUnmaskViewContainerClass adds ReplayCustomMasking integration`() { + val options = SentryReplayOptions(false, null) + options.setUnmaskViewContainerClass("com.example.MyContainer") + assertTrue(hasCustomMaskingIntegration()) + } + + @Test + fun `addMaskViewClass adds ReplayCustomMasking integration`() { + val options = SentryReplayOptions(false, null) + options.addMaskViewClass("com.example.MySensitiveView") + assertTrue(hasCustomMaskingIntegration()) + } + + @Test + fun `setMaskAllText adds ReplayCustomMasking integration`() { + val options = SentryReplayOptions(false, null) + options.setMaskAllText(false) + assertTrue(hasCustomMaskingIntegration()) + } + + @Test + fun `setMaskAllImages adds ReplayCustomMasking integration`() { + val options = SentryReplayOptions(false, null) + options.setMaskAllImages(false) + assertTrue(hasCustomMaskingIntegration()) + } } From d515e2fdc919280879b14e115fe680b35021693c Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Mon, 2 Feb 2026 13:38:49 +0100 Subject: [PATCH 2/6] chore(changelog): Add PR #5070 to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72431094bc..a097a1ebb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ ### Internal +- Add integration to track session replay custom masking ([#5070](https://github.com/getsentry/sentry-java/pull/5070)) - Establish new native exception mechanisms to differentiate events generated by `sentry-native` from `ApplicationExitInfo`. ([#5052](https://github.com/getsentry/sentry-java/pull/5052)) - Set `write` permission for `statuses` in the changelog preview GHA workflow. ([#5053](https://github.com/getsentry/sentry-java/pull/5053)) From 936a8b4f65b14f0d9f7b38b40362c6a2363b431a Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 10 Feb 2026 08:41:28 +0100 Subject: [PATCH 3/6] fix(replay): Address PR feedback for custom masking tracking Remove tracking from container class setters (RN sets them unconditionally) and add tracking when custom view tags or Compose privacy modifiers are encountered. Uses a volatile flag to avoid repeated integration additions per view. Co-Authored-By: Claude Opus 4.6 --- .../viewhierarchy/ComposeViewHierarchyNode.kt | 2 ++ .../replay/viewhierarchy/ViewHierarchyNode.kt | 3 +++ .../java/io/sentry/SentryReplayOptions.java | 17 +++++++++++++-- .../java/io/sentry/SentryReplayOptionsTest.kt | 21 ++++++++++++++++--- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt index cbcadc0391..c2c6b2ea4d 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt @@ -85,10 +85,12 @@ internal object ComposeViewHierarchyNode { ): Boolean { val sentryPrivacyModifier = this?.getOrNull(SentryReplayModifiers.SentryPrivacy) if (sentryPrivacyModifier == "unmask") { + SentryReplayOptions.trackCustomMaskingTag() return false } if (sentryPrivacyModifier == "mask") { + SentryReplayOptions.trackCustomMaskingTag() return true } diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt index 2cde60f4fb..a6c3a10052 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt @@ -8,6 +8,7 @@ import android.view.ViewParent import android.widget.ImageView import android.widget.TextView import io.sentry.SentryOptions +import io.sentry.SentryReplayOptions import io.sentry.android.replay.R import io.sentry.android.replay.util.AndroidTextLayout import io.sentry.android.replay.util.TextLayout @@ -291,6 +292,7 @@ internal sealed class ViewHierarchyNode( (tag as? String)?.lowercase()?.contains(SENTRY_UNMASK_TAG) == true || getTag(R.id.sentry_privacy) == "unmask" ) { + SentryReplayOptions.trackCustomMaskingTag() return false } @@ -298,6 +300,7 @@ internal sealed class ViewHierarchyNode( (tag as? String)?.lowercase()?.contains(SENTRY_MASK_TAG) == true || getTag(R.id.sentry_privacy) == "mask" ) { + SentryReplayOptions.trackCustomMaskingTag() return true } diff --git a/sentry/src/main/java/io/sentry/SentryReplayOptions.java b/sentry/src/main/java/io/sentry/SentryReplayOptions.java index 638c25e9d0..94d60b8926 100644 --- a/sentry/src/main/java/io/sentry/SentryReplayOptions.java +++ b/sentry/src/main/java/io/sentry/SentryReplayOptions.java @@ -15,10 +15,12 @@ import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.TestOnly; public final class SentryReplayOptions { private static final String CUSTOM_MASKING_INTEGRATION_NAME = "ReplayCustomMasking"; + private static volatile boolean customMaskingTagTracked = false; public static final String TEXT_VIEW_CLASS_NAME = "android.widget.TextView"; public static final String IMAGE_VIEW_CLASS_NAME = "android.widget.ImageView"; @@ -360,14 +362,12 @@ public long getSessionDuration() { @ApiStatus.Internal public void setMaskViewContainerClass(@NotNull String containerClass) { - addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); maskViewClasses.add(containerClass); maskViewContainerClass = containerClass; } @ApiStatus.Internal public void setUnmaskViewContainerClass(@NotNull String containerClass) { - addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); unmaskViewContainerClass = containerClass; } @@ -381,6 +381,19 @@ public void setUnmaskViewContainerClass(@NotNull String containerClass) { return unmaskViewContainerClass; } + @ApiStatus.Internal + public static void trackCustomMaskingTag() { + if (!customMaskingTagTracked) { + customMaskingTagTracked = true; + addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); + } + } + + @TestOnly + public static void resetCustomMaskingTagTracked() { + customMaskingTagTracked = false; + } + @ApiStatus.Internal public boolean isTrackConfiguration() { return trackConfiguration; diff --git a/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt b/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt index c68bf4ac21..ba2be51571 100644 --- a/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt +++ b/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt @@ -11,6 +11,7 @@ class SentryReplayOptionsTest { @BeforeTest fun setup() { SentryIntegrationPackageStorage.getInstance().clearStorage() + SentryReplayOptions.resetCustomMaskingTagTracked() } @Test @@ -163,17 +164,31 @@ class SentryReplayOptionsTest { } @Test - fun `setMaskViewContainerClass adds ReplayCustomMasking integration`() { + fun `setMaskViewContainerClass does not add ReplayCustomMasking integration`() { val options = SentryReplayOptions(false, null) options.setMaskViewContainerClass("com.example.MyContainer") - assertTrue(hasCustomMaskingIntegration()) + assertFalse(hasCustomMaskingIntegration()) } @Test - fun `setUnmaskViewContainerClass adds ReplayCustomMasking integration`() { + fun `setUnmaskViewContainerClass does not add ReplayCustomMasking integration`() { val options = SentryReplayOptions(false, null) options.setUnmaskViewContainerClass("com.example.MyContainer") + assertFalse(hasCustomMaskingIntegration()) + } + + @Test + fun `trackCustomMaskingTag adds ReplayCustomMasking integration`() { + SentryReplayOptions.trackCustomMaskingTag() + assertTrue(hasCustomMaskingIntegration()) + } + + @Test + fun `trackCustomMaskingTag only adds integration once`() { + SentryReplayOptions.trackCustomMaskingTag() + SentryReplayOptions.trackCustomMaskingTag() assertTrue(hasCustomMaskingIntegration()) + assertEquals(1, SentryIntegrationPackageStorage.getInstance().integrations.count { it == "ReplayCustomMasking" }) } @Test From 4c170162dd542955f55386e5710aaf52dc53e537 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 10 Feb 2026 08:46:09 +0100 Subject: [PATCH 4/6] fix(replay): Use trackCustomMaskingTag() consistently in all masking methods Replace direct addIntegrationToSdkVersion calls with trackCustomMaskingTag() in setMaskAllText, setMaskAllImages, addMaskViewClass, and addUnmaskViewClass so all entry points benefit from the volatile flag optimization. Co-Authored-By: Claude Opus 4.6 --- sentry/src/main/java/io/sentry/SentryReplayOptions.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sentry/src/main/java/io/sentry/SentryReplayOptions.java b/sentry/src/main/java/io/sentry/SentryReplayOptions.java index 94d60b8926..f393371585 100644 --- a/sentry/src/main/java/io/sentry/SentryReplayOptions.java +++ b/sentry/src/main/java/io/sentry/SentryReplayOptions.java @@ -282,7 +282,7 @@ public void setSessionSampleRate(final @Nullable Double sessionSampleRate) { *

Default is enabled. */ public void setMaskAllText(final boolean maskAllText) { - addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); + trackCustomMaskingTag(); if (maskAllText) { maskViewClasses.add(TEXT_VIEW_CLASS_NAME); unmaskViewClasses.remove(TEXT_VIEW_CLASS_NAME); @@ -301,7 +301,7 @@ public void setMaskAllText(final boolean maskAllText) { *

Default is enabled. */ public void setMaskAllImages(final boolean maskAllImages) { - addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); + trackCustomMaskingTag(); if (maskAllImages) { maskViewClasses.add(IMAGE_VIEW_CLASS_NAME); unmaskViewClasses.remove(IMAGE_VIEW_CLASS_NAME); @@ -317,7 +317,7 @@ public Set getMaskViewClasses() { } public void addMaskViewClass(final @NotNull String className) { - addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); + trackCustomMaskingTag(); this.maskViewClasses.add(className); } @@ -327,7 +327,7 @@ public Set getUnmaskViewClasses() { } public void addUnmaskViewClass(final @NotNull String className) { - addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); + trackCustomMaskingTag(); this.unmaskViewClasses.add(className); } From 89dd12249cea7d40ebf90ffd145de1457afbcf78 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 10 Feb 2026 08:50:40 +0100 Subject: [PATCH 5/6] refactor(replay): Rename custom masking tracking methods - customMaskingTagTracked -> customMaskingTracked - trackCustomMaskingTag() -> trackCustomMasking() - resetCustomMaskingTagTracked() -> resetCustomMaskingTracked() Co-Authored-By: Claude Opus 4.6 --- .../viewhierarchy/ComposeViewHierarchyNode.kt | 4 ++-- .../replay/viewhierarchy/ViewHierarchyNode.kt | 4 ++-- .../java/io/sentry/SentryReplayOptions.java | 20 +++++++++---------- .../java/io/sentry/SentryReplayOptionsTest.kt | 12 +++++------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt index c2c6b2ea4d..dcef27d523 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt @@ -85,12 +85,12 @@ internal object ComposeViewHierarchyNode { ): Boolean { val sentryPrivacyModifier = this?.getOrNull(SentryReplayModifiers.SentryPrivacy) if (sentryPrivacyModifier == "unmask") { - SentryReplayOptions.trackCustomMaskingTag() + SentryReplayOptions.trackCustomMasking() return false } if (sentryPrivacyModifier == "mask") { - SentryReplayOptions.trackCustomMaskingTag() + SentryReplayOptions.trackCustomMasking() return true } diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt index a6c3a10052..08add79d62 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt @@ -292,7 +292,7 @@ internal sealed class ViewHierarchyNode( (tag as? String)?.lowercase()?.contains(SENTRY_UNMASK_TAG) == true || getTag(R.id.sentry_privacy) == "unmask" ) { - SentryReplayOptions.trackCustomMaskingTag() + SentryReplayOptions.trackCustomMasking() return false } @@ -300,7 +300,7 @@ internal sealed class ViewHierarchyNode( (tag as? String)?.lowercase()?.contains(SENTRY_MASK_TAG) == true || getTag(R.id.sentry_privacy) == "mask" ) { - SentryReplayOptions.trackCustomMaskingTag() + SentryReplayOptions.trackCustomMasking() return true } diff --git a/sentry/src/main/java/io/sentry/SentryReplayOptions.java b/sentry/src/main/java/io/sentry/SentryReplayOptions.java index f393371585..c4e112f8b2 100644 --- a/sentry/src/main/java/io/sentry/SentryReplayOptions.java +++ b/sentry/src/main/java/io/sentry/SentryReplayOptions.java @@ -20,7 +20,7 @@ public final class SentryReplayOptions { private static final String CUSTOM_MASKING_INTEGRATION_NAME = "ReplayCustomMasking"; - private static volatile boolean customMaskingTagTracked = false; + private static volatile boolean customMaskingTracked = false; public static final String TEXT_VIEW_CLASS_NAME = "android.widget.TextView"; public static final String IMAGE_VIEW_CLASS_NAME = "android.widget.ImageView"; @@ -282,7 +282,7 @@ public void setSessionSampleRate(final @Nullable Double sessionSampleRate) { *

Default is enabled. */ public void setMaskAllText(final boolean maskAllText) { - trackCustomMaskingTag(); + trackCustomMasking(); if (maskAllText) { maskViewClasses.add(TEXT_VIEW_CLASS_NAME); unmaskViewClasses.remove(TEXT_VIEW_CLASS_NAME); @@ -301,7 +301,7 @@ public void setMaskAllText(final boolean maskAllText) { *

Default is enabled. */ public void setMaskAllImages(final boolean maskAllImages) { - trackCustomMaskingTag(); + trackCustomMasking(); if (maskAllImages) { maskViewClasses.add(IMAGE_VIEW_CLASS_NAME); unmaskViewClasses.remove(IMAGE_VIEW_CLASS_NAME); @@ -317,7 +317,7 @@ public Set getMaskViewClasses() { } public void addMaskViewClass(final @NotNull String className) { - trackCustomMaskingTag(); + trackCustomMasking(); this.maskViewClasses.add(className); } @@ -327,7 +327,7 @@ public Set getUnmaskViewClasses() { } public void addUnmaskViewClass(final @NotNull String className) { - trackCustomMaskingTag(); + trackCustomMasking(); this.unmaskViewClasses.add(className); } @@ -382,16 +382,16 @@ public void setUnmaskViewContainerClass(@NotNull String containerClass) { } @ApiStatus.Internal - public static void trackCustomMaskingTag() { - if (!customMaskingTagTracked) { - customMaskingTagTracked = true; + public static void trackCustomMasking() { + if (!customMaskingTracked) { + customMaskingTracked = true; addIntegrationToSdkVersion(CUSTOM_MASKING_INTEGRATION_NAME); } } @TestOnly - public static void resetCustomMaskingTagTracked() { - customMaskingTagTracked = false; + public static void resetCustomMaskingTracked() { + customMaskingTracked = false; } @ApiStatus.Internal diff --git a/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt b/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt index ba2be51571..e1391d0b40 100644 --- a/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt +++ b/sentry/src/test/java/io/sentry/SentryReplayOptionsTest.kt @@ -11,7 +11,7 @@ class SentryReplayOptionsTest { @BeforeTest fun setup() { SentryIntegrationPackageStorage.getInstance().clearStorage() - SentryReplayOptions.resetCustomMaskingTagTracked() + SentryReplayOptions.resetCustomMaskingTracked() } @Test @@ -178,15 +178,15 @@ class SentryReplayOptionsTest { } @Test - fun `trackCustomMaskingTag adds ReplayCustomMasking integration`() { - SentryReplayOptions.trackCustomMaskingTag() + fun `trackCustomMasking adds ReplayCustomMasking integration`() { + SentryReplayOptions.trackCustomMasking() assertTrue(hasCustomMaskingIntegration()) } @Test - fun `trackCustomMaskingTag only adds integration once`() { - SentryReplayOptions.trackCustomMaskingTag() - SentryReplayOptions.trackCustomMaskingTag() + fun `trackCustomMasking only adds integration once`() { + SentryReplayOptions.trackCustomMasking() + SentryReplayOptions.trackCustomMasking() assertTrue(hasCustomMaskingIntegration()) assertEquals(1, SentryIntegrationPackageStorage.getInstance().integrations.count { it == "ReplayCustomMasking" }) } From cc57cc509266aa4c8592e943466912496cac6083 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Tue, 10 Feb 2026 08:52:48 +0100 Subject: [PATCH 6/6] chore(changelog): Update PR reference to #5088 Co-Authored-By: Claude Opus 4.6 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a097a1ebb4..33deafe6e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ ### Internal -- Add integration to track session replay custom masking ([#5070](https://github.com/getsentry/sentry-java/pull/5070)) +- Add integration to track session replay custom masking ([#5088](https://github.com/getsentry/sentry-java/pull/5088)) - Establish new native exception mechanisms to differentiate events generated by `sentry-native` from `ApplicationExitInfo`. ([#5052](https://github.com/getsentry/sentry-java/pull/5052)) - Set `write` permission for `statuses` in the changelog preview GHA workflow. ([#5053](https://github.com/getsentry/sentry-java/pull/5053))