@devskin/browser-sdk 1.0.2 → 1.0.4
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/collectors/error.d.ts.map +1 -1
- package/dist/devskin.cjs.js +29 -6
- package/dist/devskin.cjs.js.map +1 -1
- package/dist/devskin.esm.js +29 -6
- package/dist/devskin.esm.js.map +1 -1
- package/dist/devskin.umd.js +29 -6
- package/dist/devskin.umd.js.map +1 -1
- package/dist/devskin.umd.min.js +2 -2
- package/dist/devskin.umd.min.js.map +1 -1
- package/dist/recorder/rrweb.d.ts +1 -0
- package/dist/recorder/rrweb.d.ts.map +1 -1
- package/dist/transport.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/collectors/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,cAAc;IAKvB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;IALnB,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,cAAc,CAAS;gBAGrB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS;IAK9B,KAAK,IAAI,IAAI;IAqBb,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIxE,aAAa,CAAC,UAAU,EAAE;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC5B,GAAG,IAAI;IAqBR,OAAO,CAAC,WAAW;IA2EnB,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,yBAAyB;IAwDjC,OAAO,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/collectors/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qBAAa,cAAc;IAKvB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;IALnB,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,cAAc,CAAS;gBAGrB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS;IAK9B,KAAK,IAAI,IAAI;IAqBb,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIxE,aAAa,CAAC,UAAU,EAAE;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;QACrC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC5B,GAAG,IAAI;IAqBR,OAAO,CAAC,WAAW;IA2EnB,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,yBAAyB;IAwDjC,OAAO,CAAC,WAAW;IA6BnB,cAAc,IAAI,UAAU,EAAE;CAG/B"}
|
package/dist/devskin.cjs.js
CHANGED
|
@@ -641,11 +641,16 @@ class ErrorCollector {
|
|
|
641
641
|
console[level] = (...args) => {
|
|
642
642
|
// Call original
|
|
643
643
|
original.apply(console, args);
|
|
644
|
-
// Add breadcrumb
|
|
644
|
+
// Add breadcrumb (skip DevSkin internal logs to avoid infinite loop)
|
|
645
645
|
if (level === 'warn' || level === 'error') {
|
|
646
|
+
const message = args.map((arg) => String(arg)).join(' ');
|
|
647
|
+
// Skip DevSkin internal messages
|
|
648
|
+
if (message.startsWith('[DevSkin]')) {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
646
651
|
this.addBreadcrumb({
|
|
647
652
|
category: 'console',
|
|
648
|
-
message:
|
|
653
|
+
message: message,
|
|
649
654
|
level: level === 'warn' ? 'warning' : 'error',
|
|
650
655
|
data: { arguments: args },
|
|
651
656
|
});
|
|
@@ -4982,6 +4987,7 @@ class RRWebRecorder {
|
|
|
4982
4987
|
this.events = [];
|
|
4983
4988
|
this.onEventsReady = null;
|
|
4984
4989
|
this.flushInterval = null;
|
|
4990
|
+
this.hasFullSnapshot = false;
|
|
4985
4991
|
this.sessionId = sessionId;
|
|
4986
4992
|
this.config = config;
|
|
4987
4993
|
this.onEventsReady = onEventsReady;
|
|
@@ -4999,9 +5005,15 @@ class RRWebRecorder {
|
|
|
4999
5005
|
console.log('[RRWeb] Starting session recording:', this.sessionId);
|
|
5000
5006
|
this.stopFn = record({
|
|
5001
5007
|
emit: (event) => {
|
|
5008
|
+
// Check if this is a FullSnapshot (type 2)
|
|
5009
|
+
if (event.type === 2) {
|
|
5010
|
+
this.hasFullSnapshot = true;
|
|
5011
|
+
console.log('[RRWeb] FullSnapshot captured! Recording is ready.');
|
|
5012
|
+
}
|
|
5002
5013
|
this.events.push(event);
|
|
5003
|
-
//
|
|
5004
|
-
|
|
5014
|
+
// Only flush if we have the FullSnapshot
|
|
5015
|
+
// This ensures the first batch always contains the full DOM
|
|
5016
|
+
if (this.hasFullSnapshot && this.events.length >= 50) {
|
|
5005
5017
|
this.flush();
|
|
5006
5018
|
}
|
|
5007
5019
|
},
|
|
@@ -5041,8 +5053,9 @@ class RRWebRecorder {
|
|
|
5041
5053
|
recordCrossOriginIframes: false, // Security: don't record cross-origin iframes
|
|
5042
5054
|
});
|
|
5043
5055
|
// Set up periodic flush (every 10 seconds)
|
|
5056
|
+
// Only flush if we have FullSnapshot to ensure first batch is complete
|
|
5044
5057
|
this.flushInterval = window.setInterval(() => {
|
|
5045
|
-
if (this.events.length > 0) {
|
|
5058
|
+
if (this.hasFullSnapshot && this.events.length > 0) {
|
|
5046
5059
|
this.flush();
|
|
5047
5060
|
}
|
|
5048
5061
|
}, 10000);
|
|
@@ -5062,8 +5075,11 @@ class RRWebRecorder {
|
|
|
5062
5075
|
clearInterval(this.flushInterval);
|
|
5063
5076
|
this.flushInterval = null;
|
|
5064
5077
|
}
|
|
5065
|
-
// Flush remaining events
|
|
5078
|
+
// Flush remaining events (even without FullSnapshot, to not lose data)
|
|
5066
5079
|
if (this.events.length > 0) {
|
|
5080
|
+
if (!this.hasFullSnapshot) {
|
|
5081
|
+
console.warn('[RRWeb] Flushing events without FullSnapshot - recording may not replay correctly');
|
|
5082
|
+
}
|
|
5067
5083
|
this.flush();
|
|
5068
5084
|
}
|
|
5069
5085
|
}
|
|
@@ -5128,6 +5144,13 @@ class Transport {
|
|
|
5128
5144
|
this.enqueue('performance', metric);
|
|
5129
5145
|
}
|
|
5130
5146
|
sendRecordingEvents(sessionId, events) {
|
|
5147
|
+
// DEBUG: Log event types being sent
|
|
5148
|
+
const eventTypes = events.reduce((acc, e) => {
|
|
5149
|
+
acc[e.type] = (acc[e.type] || 0) + 1;
|
|
5150
|
+
return acc;
|
|
5151
|
+
}, {});
|
|
5152
|
+
console.log(`[DevSkin SDK] Sending ${events.length} recording events:`, eventTypes);
|
|
5153
|
+
console.log(`[DevSkin SDK] First 3 events:`, events.slice(0, 3).map(e => ({ type: e.type, timestamp: e.timestamp })));
|
|
5131
5154
|
// Recording events can be large, send immediately
|
|
5132
5155
|
this.sendToBackend('/v1/rum/recordings', {
|
|
5133
5156
|
session_id: sessionId,
|