Skip to content

Commit 79e8ce1

Browse files
committed
Empty experimental options
1 parent 4210b0b commit 79e8ce1

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

sentry/src/main/java/io/sentry/ExperimentalOptions.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
* <p>Beware that experimental options can change at any time.
1010
*/
1111
public final class ExperimentalOptions {
12-
private @NotNull SentryReplayOptions sessionReplay = new SentryReplayOptions();
12+
private @NotNull SentryReplayOptions sessionReplay;
13+
14+
public ExperimentalOptions(final boolean empty) {
15+
this.sessionReplay = new SentryReplayOptions(empty);
16+
}
1317

1418
@NotNull
1519
public SentryReplayOptions getSessionReplay() {

sentry/src/main/java/io/sentry/SentryOptions.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public class SentryOptions {
485485

486486
@ApiStatus.Experimental private @Nullable Cron cron = null;
487487

488-
private final @NotNull ExperimentalOptions experimental = new ExperimentalOptions();
488+
private final @NotNull ExperimentalOptions experimental;
489489

490490
private @NotNull ReplayController replayController = NoOpReplayController.getInstance();
491491

@@ -2567,6 +2567,7 @@ public SentryOptions() {
25672567
* @param empty if options should be empty.
25682568
*/
25692569
private SentryOptions(final boolean empty) {
2570+
experimental = new ExperimentalOptions(empty);
25702571
if (!empty) {
25712572
// SentryExecutorService should be initialized before any
25722573
// SendCachedEventFireAndForgetIntegration

sentry/src/main/java/io/sentry/SentryReplayOptions.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ public enum SentryReplayQuality {
9696
/** The maximum duration of a full session replay, defaults to 1h. */
9797
private long sessionDuration = 60 * 60 * 1000L;
9898

99-
public SentryReplayOptions() {
100-
setRedactAllText(true);
101-
setRedactAllImages(true);
99+
public SentryReplayOptions(final boolean empty) {
100+
if (!empty) {
101+
setRedactAllText(true);
102+
setRedactAllImages(true);
103+
}
102104
}
103105

104106
public SentryReplayOptions(
105107
final @Nullable Double sessionSampleRate, final @Nullable Double onErrorSampleRate) {
106-
this();
108+
this(false);
107109
this.sessionSampleRate = sessionSampleRate;
108110
this.onErrorSampleRate = onErrorSampleRate;
109111
}

0 commit comments

Comments
 (0)