@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.
@@ -5007,15 +5007,16 @@
5007
5007
  console.log('[RRWeb] Starting session recording:', this.sessionId);
5008
5008
  this.stopFn = record({
5009
5009
  emit: (event) => {
5010
+ this.events.push(event);
5010
5011
  // Check if this is a FullSnapshot (type 2)
5011
5012
  if (event.type === 2) {
5012
5013
  this.hasFullSnapshot = true;
5013
- console.log('[RRWeb] FullSnapshot captured! Recording is ready.');
5014
+ console.log('[RRWeb] FullSnapshot captured! Sending immediately...');
5015
+ // Send immediately to ensure FullSnapshot reaches backend first
5016
+ this.flush();
5014
5017
  }
5015
- this.events.push(event);
5016
- // Only flush if we have the FullSnapshot
5017
- // This ensures the first batch always contains the full DOM
5018
- if (this.hasFullSnapshot && this.events.length >= 50) {
5018
+ else if (this.hasFullSnapshot && this.events.length >= 50) {
5019
+ // After FullSnapshot, batch other events
5019
5020
  this.flush();
5020
5021
  }
5021
5022
  },