Skip to content
Open
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 @@ -25,6 +25,18 @@ import java.io.File
import java.util.Date
import java.util.concurrent.ScheduledExecutorService

/**
* Records a rolling `errorReplayDuration` window: segments are encoded but held in memory, and
* frames and segments older than the window are dropped on every screenshot. Used when the session
* is not sampled by `sessionSampleRate` but `onErrorSampleRate` is set.
*
* Nothing is sent until [captureReplay] flushes the buffer for an error β€” sampled per error against
* `onErrorSampleRate`, unlike session mode which samples once at start. After a successful flush
* [convert] hands over to a [SessionCaptureStrategy] so the rest of the session is recorded live.
*
* Since nothing is in flight, `ReplayIntegration` deliberately keeps this strategy recording while
* rate-limited, so the buffer stays warm for when the limit expires.
*/
@SuppressLint("UseRequiresApi")
@TargetApi(26)
internal class BufferCaptureStrategy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ import io.sentry.util.FileUtils
import java.util.Date
import java.util.concurrent.ScheduledExecutorService

/**
* Records a full session: segments are encoded and sent continuously, one per
* `sessionSegmentDuration`, until the 1h `sessionDuration` deadline. Used when the session is
* sampled by `sessionSampleRate`.
*
* [captureReplay] is a no-op here β€” there is no buffer to flush, the segment covering the error is
* sent like any other. Because envelopes are in flight the whole time, `ReplayIntegration` pauses
* this strategy while offline or rate-limited so the envelope cache doesn't overflow.
*
* See [BufferCaptureStrategy] for the on-error counterpart.
*/
internal class SessionCaptureStrategy(
private val options: SentryOptions,
private val scopes: IScopes?,
Expand Down
Loading