-
-
Notifications
You must be signed in to change notification settings - Fork 369
Description
Description
I created a sample in #5055 which provides a function to reload the Sentry SDK:
static func reloadSentrySDK() {
if SentrySDK.isEnabled {
print("SentrySDK already started, closing it")
SentrySDK.close()
}
SentrySDK.start { options in
options.dsn = "https://[email protected]/5428557"
options.debug = true
options.tracesSampleRate = 1.0
options.profilesSampleRate = 1.0
options.sessionReplay.sessionSampleRate = Self.isSessionReplayEnabled ? 1.0 : 0.0
options.sessionReplay.enableExperimentalViewRenderer = Self.isExperimentalViewRendererEnabled
}
}When closing the SDK the on-demand replay capturing is not restarted.
An initial investigation showed that uninstalling the SentrySessionReplayIntegration calls the method SentrySessionReplay.pause() which invalidates the CADisplayLink used as the trigger for creating frames:
sentry-cocoa/Sources/Swift/Integrations/SessionReplay/SentrySessionReplay.swift
Lines 108 to 117 in 0782001
| func pause() { | |
| lock.lock() | |
| defer { lock.unlock() } | |
| displayLink.invalidate() | |
| if isFullSession { | |
| prepareSegmentUntil(date: dateProvider.date()) | |
| } | |
| isSessionPaused = false | |
| } |
When installing the SDK again, there seems to be left-over state and the session replay recorder is not bootstrapped correctly.
When calling stop() instead of pause() in the SentrySessionReplayIntegration, the object gets deallocated and discarded, but it is not started again correctly.
Metadata
Metadata
Assignees
Labels
Projects
Status