Skip to content

Commit 12e46a4

Browse files
committed
Revert
1 parent 9142663 commit 12e46a4

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

sentry-android-replay/src/main/java/io/sentry/android/replay/capture/CaptureStrategy.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ internal interface CaptureStrategy {
5858
companion object {
5959
private const val BREADCRUMB_START_OFFSET = 100L
6060

61-
// 5 minutes, otherwise relay will just drop it. Can prevent the case where the device
62-
// time is wrong and the segment is too long.
63-
private const val MAX_SEGMENT_DURATION = 1000L * 60 * 5
64-
6561
fun createSegment(
6662
hub: IHub?,
6763
options: SentryOptions,
@@ -80,7 +76,7 @@ internal interface CaptureStrategy {
8076
events: Deque<RRWebEvent>
8177
): ReplaySegment {
8278
val generatedVideo = cache?.createVideoOf(
83-
minOf(duration, MAX_SEGMENT_DURATION),
79+
duration,
8480
currentSegmentTimestamp.time,
8581
segmentId,
8682
height,
@@ -183,9 +179,7 @@ internal interface CaptureStrategy {
183179
recordingPayload += rrwebEvent
184180

185181
// fill in the urls array from navigation breadcrumbs
186-
if ((rrwebEvent as? RRWebBreadcrumbEvent)?.category == "navigation" &&
187-
rrwebEvent.data?.getOrElse("to", { null }) is String
188-
) {
182+
if ((rrwebEvent as? RRWebBreadcrumbEvent)?.category == "navigation") {
189183
urls.add(rrwebEvent.data!!["to"] as String)
190184
}
191185
}

sentry-android-replay/src/test/java/io/sentry/android/replay/capture/SessionCaptureStrategyTest.kt

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -336,30 +336,6 @@ class SessionCaptureStrategyTest {
336336
)
337337
}
338338

339-
@Test
340-
fun `does not throw when navigation destination is not a String`() {
341-
val now =
342-
System.currentTimeMillis() + (fixture.options.sessionReplay.sessionSegmentDuration * 5)
343-
val strategy = fixture.getSut(dateProvider = { now })
344-
strategy.start(fixture.recorderConfig)
345-
346-
fixture.scope.addBreadcrumb(Breadcrumb().apply { category = "navigation" })
347-
348-
strategy.onScreenshotRecorded(mock<Bitmap>()) {}
349-
350-
verify(fixture.scopes).captureReplay(
351-
check {
352-
assertNull(it.urls?.firstOrNull())
353-
},
354-
check {
355-
val breadcrumbEvents =
356-
it.replayRecording?.payload?.filterIsInstance<RRWebBreadcrumbEvent>()
357-
assertEquals("navigation", breadcrumbEvents?.first()?.category)
358-
assertNull(breadcrumbEvents?.first()?.data?.get("to"))
359-
}
360-
)
361-
}
362-
363339
@Test
364340
fun `sets screen from scope as replay url`() {
365341
fixture.scope.screen = "MainActivity"

0 commit comments

Comments
 (0)