Skip to content

Commit

Permalink
Empty experimental options
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn committed Oct 3, 2024
1 parent 4210b0b commit 79e8ce1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion sentry/src/main/java/io/sentry/ExperimentalOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
* <p>Beware that experimental options can change at any time.
*/
public final class ExperimentalOptions {
private @NotNull SentryReplayOptions sessionReplay = new SentryReplayOptions();
private @NotNull SentryReplayOptions sessionReplay;

public ExperimentalOptions(final boolean empty) {
this.sessionReplay = new SentryReplayOptions(empty);
}

@NotNull
public SentryReplayOptions getSessionReplay() {
Expand Down
3 changes: 2 additions & 1 deletion sentry/src/main/java/io/sentry/SentryOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public class SentryOptions {

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

private final @NotNull ExperimentalOptions experimental = new ExperimentalOptions();
private final @NotNull ExperimentalOptions experimental;

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

Expand Down Expand Up @@ -2567,6 +2567,7 @@ public SentryOptions() {
* @param empty if options should be empty.
*/
private SentryOptions(final boolean empty) {
experimental = new ExperimentalOptions(empty);
if (!empty) {
// SentryExecutorService should be initialized before any
// SendCachedEventFireAndForgetIntegration
Expand Down
10 changes: 6 additions & 4 deletions sentry/src/main/java/io/sentry/SentryReplayOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ public enum SentryReplayQuality {
/** The maximum duration of a full session replay, defaults to 1h. */
private long sessionDuration = 60 * 60 * 1000L;

public SentryReplayOptions() {
setRedactAllText(true);
setRedactAllImages(true);
public SentryReplayOptions(final boolean empty) {
if (!empty) {
setRedactAllText(true);
setRedactAllImages(true);
}
}

public SentryReplayOptions(
final @Nullable Double sessionSampleRate, final @Nullable Double onErrorSampleRate) {
this();
this(false);
this.sessionSampleRate = sessionSampleRate;
this.onErrorSampleRate = onErrorSampleRate;
}
Expand Down

0 comments on commit 79e8ce1

Please sign in to comment.