Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into fix/app-start-foreground
# Conflicts:
#	CHANGELOG.md
#	sentry-android-core/src/test/java/io/sentry/android/core/SentryAndroidTest.kt
  • Loading branch information
stefanosiano committed Jul 16, 2024
commit a5b1e28da174a7fe20c29adb2cfd81c5ced4b2c0
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,35 @@

- Check app start spans time and foreground state ([#3550](https://github.com/getsentry/sentry-java/pull/3550))

## 7.12.0

### Features

- Session Replay Public Beta ([#3339](https://github.com/getsentry/sentry-java/pull/3339))

To enable Replay use the `sessionReplay.sessionSampleRate` or `sessionReplay.errorSampleRate` experimental options.

```kotlin
import io.sentry.SentryReplayOptions
import io.sentry.android.core.SentryAndroid

SentryAndroid.init(context) { options ->

// Currently under experimental options:
options.experimental.sessionReplay.sessionSampleRate = 1.0
options.experimental.sessionReplay.errorSampleRate = 1.0

// To change default redaction behavior (defaults to true)
options.experimental.sessionReplay.redactAllImages = true
options.experimental.sessionReplay.redactAllText = true

// To change quality of the recording (defaults to MEDIUM)
options.experimental.sessionReplay.quality = SentryReplayOptions.SentryReplayQuality.MEDIUM // (LOW|MEDIUM|HIGH)
}
```

To learn more visit [Sentry's Mobile Session Replay](https://docs.sentry.io/product/explore/session-replay/mobile/) documentation page.

## 7.11.0

### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,22 @@ class SentryAndroidTest {
verify(client, times(1)).captureSession(any(), any())
}

@Test
@Config(sdk = [26])
fun `init starts session replay if app is in foreground`() {
initSentryWithForegroundImportance(true) { _ ->
assertTrue(Sentry.getCurrentHub().options.replayController.isRecording())
}
}

@Test
@Config(sdk = [26])
fun `init does not start session replay if the app is in background`() {
initSentryWithForegroundImportance(false) { _ ->
assertFalse(Sentry.getCurrentHub().options.replayController.isRecording())
}
}

@Test
fun `When initializing Sentry a callback is added to application by appStartMetrics`() {
val mockContext = ContextUtilsTestHelper.createMockContext(true)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.