Skip to content

Commit

Permalink
fix: pass through captureReplay (#4164)
Browse files Browse the repository at this point in the history
Uncomment a commented code left behind for tests.
  • Loading branch information
bruno-garcia committed Jul 15, 2024
1 parent df27b71 commit 7fadd24
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Sentry/SentrySessionReplayIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ - (void)sentrySessionStarted:(SentrySession *)session

- (void)captureReplay
{
//[self.sessionReplay captureReplay];
[self.sessionReplay captureReplay];
}

- (void)configureReplayWith:(nullable id<SentryReplayBreadcrumbConverter>)breadcrumbConverter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class SentrySessionReplay: NSObject {
setEventContext(event: event)
}

@discardableResult
func captureReplay() -> Bool {
guard isRunning else { return false }
guard !isFullSession else { return true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import XCTest
class SentryReplayRecordingTests: XCTestCase {

func test_serialize() throws {
let sut = SentryReplayRecording(segmentId: 3, size: 200, start: Date(timeIntervalSince1970: 2), duration: 5_000, frameCount: 5, frameRate: 1, height: 930, width: 390, extraEvents: nil)
let sut = SentryReplayRecording(segmentId: 3, size: 200, start: Date(timeIntervalSince1970: 2), duration: 5, frameCount: 5, frameRate: 1, height: 930, width: 390, extraEvents: nil)

let data = sut.serialize()

Expand All @@ -26,7 +26,7 @@ class SentryReplayRecordingTests: XCTestCase {
XCTAssertEqual(recordingData?["tag"] as? String, "video")
XCTAssertEqual(recordingPayload?["segmentId"] as? Int, 3)
XCTAssertEqual(recordingPayload?["size"] as? Int, 200)
XCTAssertEqual(recordingPayload?["duration"] as? Double, 5_000)
XCTAssertEqual(recordingPayload?["duration"] as? Int, 5_000)
XCTAssertEqual(recordingPayload?["encoding"] as? String, "h264")
XCTAssertEqual(recordingPayload?["container"] as? String, "mp4")
XCTAssertEqual(recordingPayload?["height"] as? Int, 930)
Expand Down

0 comments on commit 7fadd24

Please sign in to comment.