@devskin/browser-sdk 1.0.47 → 1.0.49

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.
@@ -1035,7 +1035,8 @@
1035
1035
  return `#${element.id}`;
1036
1036
  }
1037
1037
  if (element.className) {
1038
- const classes = element.className.split(' ').filter(c => c);
1038
+ const classStr = typeof element.className === 'string' ? element.className : element.className.baseVal || '';
1039
+ const classes = classStr.split(' ').filter((c) => c);
1039
1040
  if (classes.length > 0) {
1040
1041
  return `${element.tagName.toLowerCase()}.${classes.join('.')}`;
1041
1042
  }
@@ -13627,37 +13628,21 @@
13627
13628
  }
13628
13629
  sendRecordingEvents(sessionId, events) {
13629
13630
  return __awaiter$1(this, void 0, void 0, function* () {
13630
- // Calculate payload size
13631
- const payload = {
13632
- session_id: sessionId,
13633
- events,
13634
- timestamp: new Date().toISOString(),
13635
- apiKey: this.config.apiKey,
13636
- appId: this.config.appId,
13637
- };
13638
- const payloadSize = new Blob([JSON.stringify(payload)]).size;
13639
13631
  // Check if this batch contains FullSnapshot (type 2)
13640
13632
  const hasFullSnapshot = events.some(e => e.type === 2);
13641
- const maxRetries = hasFullSnapshot ? 3 : 1; // Retry FullSnapshot batches up to 3 times
13642
- // Recording events can be large, send immediately with retry logic
13633
+ const maxRetries = hasFullSnapshot ? 3 : 1;
13634
+ // ALWAYS use XHR for recording events to avoid fetch keepalive 64KB limit
13635
+ // The browser silently drops fetch requests with keepalive:true when body > 64KB
13636
+ // FullSnapshot + Meta events commonly fall in the 64KB-100KB range,
13637
+ // causing them to be silently lost while smaller IncrementalSnapshot batches succeed
13643
13638
  let lastError = null;
13644
13639
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
13645
13640
  try {
13646
- // Use XMLHttpRequest for large payloads (more reliable than fetch for large data)
13647
- if (payloadSize > 100000) { // > 100KB
13648
- yield this.sendToBackendXHR('/v1/rum/recordings', {
13649
- session_id: sessionId,
13650
- events,
13651
- timestamp: new Date().toISOString(),
13652
- });
13653
- }
13654
- else {
13655
- yield this.sendToBackend('/v1/rum/recordings', {
13656
- session_id: sessionId,
13657
- events,
13658
- timestamp: new Date().toISOString(),
13659
- });
13660
- }
13641
+ yield this.sendToBackendXHR('/v1/rum/recordings', {
13642
+ session_id: sessionId,
13643
+ events,
13644
+ timestamp: new Date().toISOString(),
13645
+ });
13661
13646
  return; // Success, exit
13662
13647
  }
13663
13648
  catch (error) {