Skip to content

Commit

Permalink
RUM-917 Fix double snapshot issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejburda committed Oct 28, 2024
1 parent 2ccc8de commit 70a4058
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ internal class SnapshotProcessor: SnapshotProcessing {
var records: [SRRecord] = []
// Create records for describing UI:
if viewTreeSnapshot.context.applicationID != lastSnapshot?.context.applicationID ||
viewTreeSnapshot.context.sessionID != lastSnapshot?.context.sessionID ||
viewTreeSnapshot.context.viewID != lastSnapshot?.context.viewID {
viewTreeSnapshot.context.sessionID != lastSnapshot?.context.sessionID {
// If RUM context ids have changed, new segment should be started.
// Segment must always start with "meta" → "focus" → "full snapshot" records.
records.append(recordsBuilder.createMetaRecord(from: viewTreeSnapshot))
Expand All @@ -119,7 +118,7 @@ internal class SnapshotProcessor: SnapshotProcessing {
.flatMap { records.append($0) }
}
} else {
telemetry.error("[SR] Unexpected flow in `Processor`: no previous wireframes and no previous RUM context")
// Initial snapshot
records.append(recordsBuilder.createFullSnapshotRecord(from: viewTreeSnapshot, wireframes: wireframes))
}

Expand Down

0 comments on commit 70a4058

Please sign in to comment.