@devskin/browser-sdk 1.0.47 → 1.0.48
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.
- package/dist/devskin.cjs.js +10 -26
- package/dist/devskin.cjs.js.map +1 -1
- package/dist/devskin.esm.js +10 -26
- package/dist/devskin.esm.js.map +1 -1
- package/dist/devskin.umd.js +10 -26
- package/dist/devskin.umd.js.map +1 -1
- package/dist/devskin.umd.min.js +1 -1
- package/dist/devskin.umd.min.js.map +1 -1
- package/dist/transport.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/devskin.umd.js
CHANGED
|
@@ -13627,37 +13627,21 @@
|
|
|
13627
13627
|
}
|
|
13628
13628
|
sendRecordingEvents(sessionId, events) {
|
|
13629
13629
|
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
13630
|
// Check if this batch contains FullSnapshot (type 2)
|
|
13640
13631
|
const hasFullSnapshot = events.some(e => e.type === 2);
|
|
13641
|
-
const maxRetries = hasFullSnapshot ? 3 : 1;
|
|
13642
|
-
//
|
|
13632
|
+
const maxRetries = hasFullSnapshot ? 3 : 1;
|
|
13633
|
+
// ALWAYS use XHR for recording events to avoid fetch keepalive 64KB limit
|
|
13634
|
+
// The browser silently drops fetch requests with keepalive:true when body > 64KB
|
|
13635
|
+
// FullSnapshot + Meta events commonly fall in the 64KB-100KB range,
|
|
13636
|
+
// causing them to be silently lost while smaller IncrementalSnapshot batches succeed
|
|
13643
13637
|
let lastError = null;
|
|
13644
13638
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
13645
13639
|
try {
|
|
13646
|
-
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
|
|
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
|
-
}
|
|
13640
|
+
yield this.sendToBackendXHR('/v1/rum/recordings', {
|
|
13641
|
+
session_id: sessionId,
|
|
13642
|
+
events,
|
|
13643
|
+
timestamp: new Date().toISOString(),
|
|
13644
|
+
});
|
|
13661
13645
|
return; // Success, exit
|
|
13662
13646
|
}
|
|
13663
13647
|
catch (error) {
|