Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
@objcMembers
@_spi(Private) public class SentryANRStoppedResult: NSObject {

let minDuration: TimeInterval
let maxDuration: TimeInterval
public let minDuration: TimeInterval
public let maxDuration: TimeInterval

init(minDuration: TimeInterval, maxDuration: TimeInterval) {
public init(minDuration: TimeInterval, maxDuration: TimeInterval) {

Check warning on line 17 in Sources/Swift/Core/Integrations/ANR/SentryANRTrackerV2Delegate.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Integrations/ANR/SentryANRTrackerV2Delegate.swift#L17

Added line #L17 was not covered by tests
self.minDuration = minDuration
self.maxDuration = maxDuration
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Swift/Core/Integrations/ANR/SentryANRType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

@objc
static func getFatalExceptionType(nonFatalErrorType: String) -> String {
public static func getFatalExceptionType(nonFatalErrorType: String) -> String {

Check warning on line 40 in Sources/Swift/Core/Integrations/ANR/SentryANRType.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Integrations/ANR/SentryANRType.swift#L40

Added line #L40 was not covered by tests
if nonFatalErrorType == ExceptionType.nonFullyBlocking.rawValue {
return ExceptionType.fatalNonFullyBlocking.rawValue
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
@_spi(Private) public class SentryFramesDelayResult: NSObject {
/// The frames delay for the passed time period. If frame delay can't be calculated this is -1.
public let delayDuration: CFTimeInterval
let framesContributingToDelayCount: UInt
public let framesContributingToDelayCount: UInt

init(delayDuration: CFTimeInterval, framesContributingToDelayCount: UInt) {
self.delayDuration = delayDuration
Expand Down
2 changes: 1 addition & 1 deletion Sources/Swift/Core/MetricKit/SentryMXManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import MetricKit
self.disableCrashDiagnostics = disableCrashDiagnostics
}

weak var delegate: SentryMXManagerDelegate?
public weak var delegate: SentryMXManagerDelegate?

public func receiveReports() {
let shared = MXMetricManager.shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@objcMembers
@_spi(Private) public class SentryDefaultViewRenderer: NSObject, SentryViewRenderer {
func render(view: UIView) -> UIImage {
public func render(view: UIView) -> UIImage {

Check warning on line 8 in Sources/Swift/Core/Tools/ViewCapture/SentryDefaultViewRenderer.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Tools/ViewCapture/SentryDefaultViewRenderer.swift#L8

Added line #L8 was not covered by tests
let image = UIGraphicsImageRenderer(size: view.bounds.size).image { _ in
view.drawHierarchy(in: view.bounds, afterScreenUpdates: false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

override private init() {}

static func maskView(_ view: UIView) {
@_spi(Private) public static func maskView(_ view: UIView) {

Check warning on line 19 in Sources/Swift/Core/Tools/ViewCapture/SentryRedactViewHelper.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Tools/ViewCapture/SentryRedactViewHelper.swift#L19

Added line #L19 was not covered by tests
objc_setAssociatedObject(view, &associatedRedactObjectHandle, true, .OBJC_ASSOCIATION_ASSIGN)
}

Expand All @@ -28,7 +28,7 @@
(objc_getAssociatedObject(view, &associatedIgnoreObjectHandle) as? NSNumber)?.boolValue ?? false
}

static func unmaskView(_ view: UIView) {
@_spi(Private) public static func unmaskView(_ view: UIView) {

Check warning on line 31 in Sources/Swift/Core/Tools/ViewCapture/SentryRedactViewHelper.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Tools/ViewCapture/SentryRedactViewHelper.swift#L31

Added line #L31 was not covered by tests
objc_setAssociatedObject(view, &associatedIgnoreObjectHandle, true, .OBJC_ASSOCIATION_ASSIGN)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// - enableMaskRendererV2: Flag to enable experimental view renderer.
/// - Note: The option `enableMaskRendererV2` is an internal flag, which is not part of the public API.
/// Therefore, it is not part of the the `redactOptions` parameter, to not further expose it.
init(
public init(
renderer: SentryViewRenderer,
redactOptions: SentryRedactOptions,
enableMaskRendererV2: Bool
Expand All @@ -33,7 +33,7 @@
super.init()
}

func image(view: UIView, onComplete: @escaping ScreenshotCallback) {
public func image(view: UIView, onComplete: @escaping ScreenshotCallback) {

Check warning on line 36 in Sources/Swift/Core/Tools/ViewCapture/SentryViewPhotographer.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Tools/ViewCapture/SentryViewPhotographer.swift#L36

Added line #L36 was not covered by tests
let viewSize = view.bounds.size
let redactRegions = redactBuilder.redactRegionsFor(view: view)
// The render method is synchronous and must be called on the main thread.
Expand All @@ -50,7 +50,7 @@
}
}

func image(view: UIView) -> UIImage {
public func image(view: UIView) -> UIImage {

Check warning on line 53 in Sources/Swift/Core/Tools/ViewCapture/SentryViewPhotographer.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Tools/ViewCapture/SentryViewPhotographer.swift#L53

Added line #L53 was not covered by tests
let viewSize = view.bounds.size
let redactRegions = redactBuilder.redactRegionsFor(view: view)
let renderedScreenshot = renderer.render(view: view)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import UIKit

@objc protocol SentryViewRenderer {
@objc @_spi(Private) public protocol SentryViewRenderer {
func render(view: UIView) -> UIImage
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
@_spi(Private) public class SentryViewRendererV2: NSObject, SentryViewRenderer {
let enableFastViewRendering: Bool

init(enableFastViewRendering: Bool) {
public init(enableFastViewRendering: Bool) {

Check warning on line 10 in Sources/Swift/Core/Tools/ViewCapture/SentryViewRendererV2.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Tools/ViewCapture/SentryViewRendererV2.swift#L10

Added line #L10 was not covered by tests
self.enableFastViewRendering = enableFastViewRendering
}

func render(view: UIView) -> UIImage {
public func render(view: UIView) -> UIImage {

Check warning on line 14 in Sources/Swift/Core/Tools/ViewCapture/SentryViewRendererV2.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Core/Tools/ViewCapture/SentryViewRendererV2.swift#L14

Added line #L14 was not covered by tests
let scale = (view as? UIWindow ?? view.window)?.screen.scale ?? 1
let image = SentryGraphicsImageRenderer(size: view.bounds.size, scale: scale).image { context in
if enableFastViewRendering {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import Foundation
import UIKit

typealias ScreenshotCallback = (_ maskedViewImage: UIImage) -> Void
@_spi(Private) public typealias ScreenshotCallback = (_ maskedViewImage: UIImage) -> Void

@objc
protocol SentryViewScreenshotProvider: NSObjectProtocol {
@_spi(Private) public protocol SentryViewScreenshotProvider: NSObjectProtocol {
func image(view: UIView, onComplete: @escaping ScreenshotCallback)
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions Sources/Swift/Helper/SentryDispatchQueueWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}

@objc(dispatchAsyncWithBlock:)
func dispatchAsync(_ block: @escaping () -> Void) {
public func dispatchAsync(_ block: @escaping () -> Void) {
internalWrapper.dispatchAsync(block)
}

Expand All @@ -29,16 +29,16 @@
}

@objc(dispatchAsyncOnMainQueue:)
func dispatchAsyncOnMainQueue(block: @escaping () -> Void) {
public func dispatchAsyncOnMainQueue(block: @escaping () -> Void) {
internalWrapper.dispatchAsyncOnMainQueue(block: block)
}

@objc(dispatchSyncOnMainQueue:)
func dispatchSyncOnMainQueue(block: @escaping () -> Void) {
public func dispatchSyncOnMainQueue(block: @escaping () -> Void) {

Check warning on line 37 in Sources/Swift/Helper/SentryDispatchQueueWrapper.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Helper/SentryDispatchQueueWrapper.swift#L37

Added line #L37 was not covered by tests
internalWrapper.dispatchSyncOnMainQueue(block: block)
}

func dispatchSyncOnMainQueue(_ block: @escaping () -> Void, timeout: Double) {
public func dispatchSyncOnMainQueue(_ block: @escaping () -> Void, timeout: Double) {
internalWrapper.dispatchSync(onMainQueue: block, timeout: timeout)
}

Expand All @@ -50,7 +50,7 @@
internalWrapper.dispatchCancel(block)
}

func dispatchOnce(_ predicate: UnsafeMutablePointer<CLong>, block: @escaping () -> Void) {
public func dispatchOnce(_ predicate: UnsafeMutablePointer<CLong>, block: @escaping () -> Void) {

Check warning on line 53 in Sources/Swift/Helper/SentryDispatchQueueWrapper.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Helper/SentryDispatchQueueWrapper.swift#L53

Added line #L53 was not covered by tests
internalWrapper.dispatchOnce(predicate, block: block)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import UIKit
private var imageView = UIImageView()
private var idle = true

var opacity: Float {
public var opacity: Float {
get { return Float(imageView.alpha) }
set { imageView.alpha = CGFloat(newValue)}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

final class SentryRRWebBreadcrumbEvent: SentryRRWebCustomEvent {
@_spi(Private) public final class SentryRRWebBreadcrumbEvent: SentryRRWebCustomEvent {
init(timestamp: Date, category: String, message: String? = nil, level: SentryLevel = .none, data: [String: Any]? = nil) {

var payload: [String: Any] = ["type": "default", "category": category, "level": level.description, "timestamp": timestamp.timeIntervalSince1970 ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enum SentryRRWebEventType: Int {
}

@objc(SentryRRWebEvent)
protocol SentryRRWebEventProtocol: SentrySerializable {
@_spi(Private) public protocol SentryRRWebEventProtocol: SentrySerializable {
}

@objcMembers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
set { _frames = newValue }
}
#endif // SENTRY_TEST || SENTRY_TEST_CI || DEBUG
var videoScale: Float = 1
var bitRate = 20_000
var frameRate = 1
var cacheMaxSize = UInt.max
public var videoScale: Float = 1
public var bitRate = 20_000
public var frameRate = 1
public var cacheMaxSize = UInt.max

Check warning on line 32 in Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift#L29-L32

Added lines #L29 - L32 were not covered by tests

init(
public init(
outputPath: String,
processingQueue: SentryDispatchQueueWrapper,
assetWorkerQueue: SentryDispatchQueueWrapper
Expand All @@ -42,7 +42,7 @@
self.assetWorkerQueue = assetWorkerQueue
}

convenience init(
public convenience init(
withContentFrom outputPath: String,
processingQueue: SentryDispatchQueueWrapper,
assetWorkerQueue: SentryDispatchQueueWrapper
Expand Down Expand Up @@ -142,7 +142,7 @@
}
}

var oldestFrameDate: Date? {
public var oldestFrameDate: Date? {

Check warning on line 145 in Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift#L145

Added line #L145 was not covered by tests
return _frames.first?.time
}

Expand All @@ -157,7 +157,7 @@
}
}

func createVideoWith(beginning: Date, end: Date) -> [SentryVideoInfo] {
public func createVideoWith(beginning: Date, end: Date) -> [SentryVideoInfo] {

Check warning on line 160 in Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift#L160

Added line #L160 was not covered by tests
SentryLog.debug("[Session Replay] Creating video with beginning: \(beginning), end: \(end)")
// Note: In previous implementations this method was wrapped by a sync call to the processing queue.
// As this method is already called from the processing queue, we must remove the sync call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
*
* - Note: See ``SentryReplayOptions.DefaultValues.quality`` for the default value.
*/
var replayBitRate: Int {
@_spi(Private) public var replayBitRate: Int {

Check warning on line 225 in Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift#L225

Added line #L225 was not covered by tests
quality.bitrate
}

Expand All @@ -231,7 +231,7 @@
*
* - Note: The scale is used to reduce the size of the replay.
*/
var sizeScale: Float {
@_spi(Private) public var sizeScale: Float {

Check warning on line 234 in Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentryReplayOptions.swift#L234

Added line #L234 was not covered by tests
quality.sizeScale
}

Expand All @@ -242,7 +242,7 @@
*
* - Note: See ``SentryReplayOptions.DefaultValues.frameRate`` for the default value.
*/
var frameRate: UInt {
@_spi(Private) public var frameRate: UInt {
didSet {
if frameRate < 1 {
frameRate = 1
Expand All @@ -253,12 +253,12 @@
/**
* The maximum duration of replays for error events.
*/
var errorReplayDuration: TimeInterval
@_spi(Private) public var errorReplayDuration: TimeInterval

/**
* The maximum duration of the segment of a session replay.
*/
var sessionSegmentDuration: TimeInterval
@_spi(Private) public var sessionSegmentDuration: TimeInterval

/**
* The maximum duration of a replay session.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
let height: Int
let width: Int

convenience init(segmentId: Int, video: SentryVideoInfo, extraEvents: [any SentryRRWebEventProtocol]) {
public convenience init(segmentId: Int, video: SentryVideoInfo, extraEvents: [any SentryRRWebEventProtocol]) {

Check warning on line 16 in Sources/Swift/Integrations/SessionReplay/SentryReplayRecording.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentryReplayRecording.swift#L16

Added line #L16 was not covered by tests
self.init(segmentId: segmentId, size: video.fileSize, start: video.start, duration: video.duration, frameCount: video.frameCount, frameRate: video.frameRate, height: video.height, width: video.width, extraEvents: extraEvents)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Foundation

@objc
protocol SentryReplayBreadcrumbConverter: NSObjectProtocol {
@_spi(Private) public protocol SentryReplayBreadcrumbConverter: NSObjectProtocol {
func convert(from breadcrumb: Breadcrumb) -> SentryRRWebEventProtocol?
}

Expand All @@ -23,7 +23,7 @@
* Any deviation in the information will cause the breadcrumb or the information itself to be discarded
* in order to avoid unknown behavior in the front-end.
*/
func convert(from breadcrumb: Breadcrumb) -> SentryRRWebEventProtocol? {
public func convert(from breadcrumb: Breadcrumb) -> SentryRRWebEventProtocol? {

Check warning on line 26 in Sources/Swift/Integrations/SessionReplay/SentrySRDefaultBreadcrumbConverter.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySRDefaultBreadcrumbConverter.swift#L26

Added line #L26 was not covered by tests
guard let timestamp = breadcrumb.timestamp else { return nil }
if breadcrumb.category == "http" {
return networkSpan(breadcrumb)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// swiftlint:disable type_body_length
@objcMembers
@_spi(Private) public class SentrySessionReplay: NSObject {
private(set) var isFullSession = false
private(set) var sessionReplayId: SentryId?
public private(set) var isFullSession = false

Check warning on line 9 in Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L9

Added line #L9 was not covered by tests
public private(set) var sessionReplayId: SentryId?

private var urlToCache: URL?
private var rootView: UIView?
Expand All @@ -27,14 +27,14 @@
private let dateProvider: SentryCurrentDateProvider
private let touchTracker: SentryTouchTracker?
private let lock = NSLock()
var replayTags: [String: Any]?
public var replayTags: [String: Any]?

var isRunning: Bool {
displayLink.isRunning()
}

var screenshotProvider: SentryViewScreenshotProvider
var breadcrumbConverter: SentryReplayBreadcrumbConverter
public var screenshotProvider: SentryViewScreenshotProvider
public var breadcrumbConverter: SentryReplayBreadcrumbConverter

init(
replayOptions: SentryReplayOptions,
Expand All @@ -60,7 +60,7 @@

deinit { displayLink.invalidate() }

func start(rootView: UIView, fullSession: Bool) {
public func start(rootView: UIView, fullSession: Bool) {

Check warning on line 63 in Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L63

Added line #L63 was not covered by tests
SentryLog.debug("[Session Replay] Starting session replay with full session: \(fullSession)")
guard !isRunning else {
SentryLog.debug("[Session Replay] Session replay is already running, not starting again")
Expand All @@ -87,7 +87,7 @@
delegate?.sessionReplayStarted(replayId: sessionReplayId)
}

func pauseSessionMode() {
public func pauseSessionMode() {

Check warning on line 90 in Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L90

Added line #L90 was not covered by tests
SentryLog.debug("[Session Replay] Pausing session mode")
lock.lock()
defer { lock.unlock() }
Expand All @@ -96,7 +96,7 @@
self.videoSegmentStart = nil
}

func pause() {
public func pause() {

Check warning on line 99 in Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L99

Added line #L99 was not covered by tests
SentryLog.debug("[Session Replay] Pausing session")
lock.lock()
defer { lock.unlock() }
Expand All @@ -108,7 +108,7 @@
isSessionPaused = false
}

func resume() {
public func resume() {

Check warning on line 111 in Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L111

Added line #L111 was not covered by tests
SentryLog.debug("[Session Replay] Resuming session")
lock.lock()
defer { lock.unlock() }
Expand All @@ -131,7 +131,7 @@
displayLink.link(withTarget: self, selector: #selector(newFrame(_:)))
}

func captureReplayFor(event: Event) {
public func captureReplayFor(event: Event) {

Check warning on line 134 in Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L134

Added line #L134 was not covered by tests
SentryLog.debug("[Session Replay] Capturing replay for event: \(event)")
guard isRunning else {
SentryLog.debug("[Session Replay] Session replay is not running, not capturing replay")
Expand All @@ -153,8 +153,8 @@
}

@discardableResult
func captureReplay() -> Bool {
guard isRunning else {
public func captureReplay() -> Bool {
guard isRunning else {

Check warning on line 157 in Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift#L156-L157

Added lines #L156 - L157 were not covered by tests
SentryLog.debug("[Session Replay] Session replay is not running, not capturing replay")
return false
}
Expand Down
Loading
Loading