@devskin/browser-sdk 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5005,15 +5005,16 @@ class RRWebRecorder {
5005
5005
  console.log('[RRWeb] Starting session recording:', this.sessionId);
5006
5006
  this.stopFn = record({
5007
5007
  emit: (event) => {
5008
+ this.events.push(event);
5008
5009
  // Check if this is a FullSnapshot (type 2)
5009
5010
  if (event.type === 2) {
5010
5011
  this.hasFullSnapshot = true;
5011
- console.log('[RRWeb] FullSnapshot captured! Recording is ready.');
5012
+ console.log('[RRWeb] FullSnapshot captured! Sending immediately...');
5013
+ // Send immediately to ensure FullSnapshot reaches backend first
5014
+ this.flush();
5012
5015
  }
5013
- this.events.push(event);
5014
- // Only flush if we have the FullSnapshot
5015
- // This ensures the first batch always contains the full DOM
5016
- if (this.hasFullSnapshot && this.events.length >= 50) {
5016
+ else if (this.hasFullSnapshot && this.events.length >= 50) {
5017
+ // After FullSnapshot, batch other events
5017
5018
  this.flush();
5018
5019
  }
5019
5020
  },