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