Skip to content

Commit d1eb13d

Browse files
fix: reset nodeIds during fullsnapshot (#412)
## Summary Minor fixes to clear state during on fullsnapshot <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small, localized state-reset change in replay event generation; low risk aside from potentially affecting downstream expectations about node ID reuse. > > **Overview** > Resets session replay DOM-image mapping state when generating a `FULL_SNAPSHOT` by clearing `nodeIds` at the start of `generateCaptureFullEvents`. > > This prevents stale image signature→node ID mappings from leaking across multiple full captures in the same session, improving correctness of subsequent mutation/removal events. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f7e7da8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent f99f90f commit d1eb13d

File tree

1 file changed

+1
-0
lines changed
  • sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/exporter

1 file changed

+1
-0
lines changed

sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/exporter/RRWebEventGenerator.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ class RRWebEventGenerator(
190190
*/
191191
fun generateCaptureFullEvents(exportFrame: ExportFrame): List<Event> {
192192
if (exportFrame.addImages.isEmpty()) return emptyList()
193+
nodeIds.clear()
193194
val eventBatch = mutableListOf<Event>()
194195
knownKeyFrameId = exportFrame.keyFrameId
195196

0 commit comments

Comments
 (0)