diff --git a/CHANGELOG.md b/CHANGELOG.md index 07f38f8075..e559832779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ - Send UI Profiling app start chunk when it finishes ([#4423](https://github.com/getsentry/sentry-java/pull/4423)) - Republish Javadoc [#4457](https://github.com/getsentry/sentry-java/pull/4457) - Finalize `OkHttpEvent` even if no active span in `SentryOkHttpInterceptor` [#4469](https://github.com/getsentry/sentry-java/pull/4469) -- Correctly capture Dialogs and non full-sized windows ([#4354](https://github.com/getsentry/sentry-java/pull/4354)) +- Session Replay: Correctly capture Dialogs and non full-sized windows ([#4354](https://github.com/getsentry/sentry-java/pull/4354)) +- Session Replay: Fix inconsistent `segment_id` ([#4471](https://github.com/getsentry/sentry-java/pull/4471)) ## 8.13.2 diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BaseCaptureStrategy.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BaseCaptureStrategy.kt index f29aaa3cac..eebae849f1 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BaseCaptureStrategy.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BaseCaptureStrategy.kt @@ -107,7 +107,6 @@ internal abstract class BaseCaptureStrategy( override fun stop() { cache?.close() - currentSegment = -1 replayStartTimestamp.set(0) segmentTimestamp = null currentReplayId = SentryId.EMPTY_ID diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BufferCaptureStrategy.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BufferCaptureStrategy.kt index 1f4c1b7660..b43d4e1e1d 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BufferCaptureStrategy.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BufferCaptureStrategy.kt @@ -57,6 +57,7 @@ internal class BufferCaptureStrategy( val replayCacheDir = cache?.replayCacheDir replayExecutor.submitSafely(options, "$TAG.stop") { FileUtils.deleteRecursively(replayCacheDir) + currentSegment = -1 } super.stop() } @@ -205,7 +206,6 @@ internal class BufferCaptureStrategy( } else { DateUtils.getDateTime(now - errorReplayDuration) } - val segmentId = currentSegment val duration = now - currentSegmentTimestamp.time val replayId = currentReplayId @@ -215,7 +215,7 @@ internal class BufferCaptureStrategy( duration, currentSegmentTimestamp, replayId, - segmentId, + currentSegment, currentConfig.recordingHeight, currentConfig.recordingWidth, currentConfig.frameRate, diff --git a/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/SessionCaptureStrategy.kt b/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/SessionCaptureStrategy.kt index 34a4510be7..6ed7a3956b 100644 --- a/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/SessionCaptureStrategy.kt +++ b/sentry-android-replay/src/main/java/io/sentry/android/replay/capture/SessionCaptureStrategy.kt @@ -59,6 +59,7 @@ internal class SessionCaptureStrategy( if (segment is ReplaySegment.Created) { segment.capture(scopes) } + currentSegment = -1 FileUtils.deleteRecursively(replayCacheDir) } scopes?.configureScope { it.replayId = SentryId.EMPTY_ID } @@ -159,7 +160,6 @@ internal class SessionCaptureStrategy( val now = dateProvider.currentTimeMillis val currentSegmentTimestamp = segmentTimestamp ?: return - val segmentId = currentSegment val duration = now - currentSegmentTimestamp.time val replayId = currentReplayId replayExecutor.submitSafely(options, "$TAG.$taskName") { @@ -168,7 +168,7 @@ internal class SessionCaptureStrategy( duration, currentSegmentTimestamp, replayId, - segmentId, + currentSegment, currentConfig.recordingHeight, currentConfig.recordingWidth, currentConfig.frameRate,
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: