@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.esm.js
CHANGED
|
@@ -13621,37 +13621,21 @@ class Transport {
|
|
|
13621
13621
|
}
|
|
13622
13622
|
sendRecordingEvents(sessionId, events) {
|
|
13623
13623
|
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
13624
|
// Check if this batch contains FullSnapshot (type 2)
|
|
13634
13625
|
const hasFullSnapshot = events.some(e => e.type === 2);
|
|
13635
|
-
const maxRetries = hasFullSnapshot ? 3 : 1;
|
|
13636
|
-
//
|
|
13626
|
+
const maxRetries = hasFullSnapshot ? 3 : 1;
|
|
13627
|
+
// ALWAYS use XHR for recording events to avoid fetch keepalive 64KB limit
|
|
13628
|
+
// The browser silently drops fetch requests with keepalive:true when body > 64KB
|
|
13629
|
+
// FullSnapshot + Meta events commonly fall in the 64KB-100KB range,
|
|
13630
|
+
// causing them to be silently lost while smaller IncrementalSnapshot batches succeed
|
|
13637
13631
|
let lastError = null;
|
|
13638
13632
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
13639
13633
|
try {
|
|
13640
|
-
|
|
13641
|
-
|
|
13642
|
-
|
|
13643
|
-
|
|
13644
|
-
|
|
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
|
-
}
|
|
13634
|
+
yield this.sendToBackendXHR('/v1/rum/recordings', {
|
|
13635
|
+
session_id: sessionId,
|
|
13636
|
+
events,
|
|
13637
|
+
timestamp: new Date().toISOString(),
|
|
13638
|
+
});
|
|
13655
13639
|
return; // Success, exit
|
|
13656
13640
|
}
|
|
13657
13641
|
catch (error) {
|