Skip to content

Conversation

@cdillard-NewRelic
Copy link
Member

@cdillard-NewRelic cdillard-NewRelic commented Dec 15, 2025

Triggered by various error types: Handled Exception and LogError and recordError only currently.

When transitioning from error mode to full mode full session replay is enabled.

Full Snapshot Capture:

Session replay is now configured to capture a full snapshot every 15 seconds, ensuring that each replay commences with a comprehensive snapshot.

@cdillard-NewRelic cdillard-NewRelic marked this pull request as ready for review December 16, 2025 19:48
}

/// Checks if a full snapshot should be forced (every 15 seconds)
private func checkAndForceFullSnapshot(for frame: SessionReplayFrame) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkAndForceFullSnapshot:

  • This is running even while in full mode when it shouldn't be.
  • It should only apply to the persisted frames because in memory frames are processed at harvest time.
  • I think it needs rethought because the first frame needs to be a full frame not just every 15.
    - Maybe doing this and keeping 30 frames but deleting in batches of 15 might work.
    - Or coping in some of my changes for chunking that allows for the raw frames to be persisted instead of the processed frames. If we do it this way this logic shouldn't be needed at all. Just process the frames at harvest time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to only run in error mode. I've change this to use the sliding window. changed to only use persisted frames.

// Process buffered frames to file for persistence
DispatchQueue.global(qos: .background).async { [weak self] in
guard let self = self else { return }
self.processFrameToFile(bufferedFrame.frame)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't these frames already being persisted to file while they're captured?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but this is capturing them to a seperate error buffer. It seems to work. 🤷

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this part. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants