@zaplier/sdk 1.3.4 → 1.3.5
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/index.cjs +24 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +24 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/sdk.js +24 -4
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.min.js +1 -1
- package/dist/src/modules/session-replay.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/sdk.js
CHANGED
|
@@ -19012,6 +19012,7 @@
|
|
|
19012
19012
|
!function(t2) {
|
|
19013
19013
|
t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
|
|
19014
19014
|
}(n || (n = {}));
|
|
19015
|
+
const { takeFullSnapshot } = record;
|
|
19015
19016
|
|
|
19016
19017
|
/**
|
|
19017
19018
|
* Session Replay Engine
|
|
@@ -19069,6 +19070,19 @@
|
|
|
19069
19070
|
this.hasFullSnapshot = false;
|
|
19070
19071
|
this.startTime = Date.now();
|
|
19071
19072
|
this.startBatchTimer();
|
|
19073
|
+
// WORKAROUND: Force FullSnapshot creation to fix rrweb 2.0.0-alpha bug
|
|
19074
|
+
// where FullSnapshot is sometimes not created as the first event
|
|
19075
|
+
setTimeout(() => {
|
|
19076
|
+
if (!this.hasFullSnapshot) {
|
|
19077
|
+
console.warn("[Zaplier] ⚠️ FullSnapshot not created automatically, forcing manual capture...");
|
|
19078
|
+
try {
|
|
19079
|
+
takeFullSnapshot(true); // Force a new FullSnapshot
|
|
19080
|
+
}
|
|
19081
|
+
catch (error) {
|
|
19082
|
+
console.error("[Zaplier] Failed to force FullSnapshot:", error);
|
|
19083
|
+
}
|
|
19084
|
+
}
|
|
19085
|
+
}, 500); // Give rrweb a chance to create natural FullSnapshot first
|
|
19072
19086
|
// Set timeout to check if FullSnapshot was captured
|
|
19073
19087
|
this.snapshotTimeout = window.setTimeout(() => {
|
|
19074
19088
|
if (!this.hasFullSnapshot) {
|
|
@@ -19076,11 +19090,17 @@
|
|
|
19076
19090
|
eventsReceived: this.events.length,
|
|
19077
19091
|
eventTypes: this.events.map((e) => e.type).slice(0, 10),
|
|
19078
19092
|
});
|
|
19079
|
-
//
|
|
19080
|
-
|
|
19093
|
+
// Try one more forced snapshot as last resort
|
|
19094
|
+
try {
|
|
19095
|
+
console.warn("[Zaplier] Last resort: forcing FullSnapshot...");
|
|
19096
|
+
takeFullSnapshot(true);
|
|
19097
|
+
}
|
|
19098
|
+
catch (error) {
|
|
19099
|
+
console.error("[Zaplier] Failed to create emergency FullSnapshot:", error);
|
|
19100
|
+
}
|
|
19081
19101
|
}
|
|
19082
19102
|
else {
|
|
19083
|
-
console.log("[Zaplier] FullSnapshot confirmed captured");
|
|
19103
|
+
console.log("[Zaplier] ✅ FullSnapshot confirmed captured");
|
|
19084
19104
|
}
|
|
19085
19105
|
}, 5000);
|
|
19086
19106
|
console.log("[Zaplier] Session replay started with rrweb");
|
|
@@ -19321,7 +19341,7 @@
|
|
|
19321
19341
|
*/
|
|
19322
19342
|
class ZaplierSDK {
|
|
19323
19343
|
constructor(userConfig) {
|
|
19324
|
-
this.version = "1.3.
|
|
19344
|
+
this.version = "1.3.5";
|
|
19325
19345
|
this.isInitialized = false;
|
|
19326
19346
|
this.eventQueue = [];
|
|
19327
19347
|
/**
|