@newtalaria/browser 0.1.8 → 0.1.9
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/README.md +11 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/index.js +79 -9
- package/dist/index.js.map +3 -3
- package/dist/replay/paint_base_size.d.ts +18 -0
- package/dist/replay/paint_base_size.d.ts.map +1 -0
- package/dist/replay/segment_buffer.d.ts +2 -0
- package/dist/replay/segment_buffer.d.ts.map +1 -1
- package/dist/talaria.browser.iife.js +79 -9
- package/dist/talaria.browser.iife.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,6 +114,17 @@ When an **error/fatal** event attempts an on-error clip (`replaysSessionSampleRa
|
|
|
114
114
|
|
|
115
115
|
Failed captures do **not** set `replayId` (avoids linking a blank player). Details are also under `extra.replayCapture`.
|
|
116
116
|
|
|
117
|
+
When the paint base cannot ship, `extra.replayCapture` also includes size diagnostics where available:
|
|
118
|
+
|
|
119
|
+
| Field | Meaning |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| `fullSnapshotEstimatedBytes` | JSON size estimate of the FullSnapshot |
|
|
122
|
+
| `fullSnapshotCompressedBytes` | Gzip size of the FullSnapshot alone (when measured) |
|
|
123
|
+
| `metaEstimatedBytes` | JSON size estimate of the Meta event |
|
|
124
|
+
| `maxUncompressedSegmentBytes` / `maxCompressedSegmentBytes` | Current pack caps |
|
|
125
|
+
|
|
126
|
+
Use these to see how far over budget a CMS/admin snapshot was when a clip was aborted.
|
|
127
|
+
|
|
117
128
|
## Serverpod URL pattern
|
|
118
129
|
|
|
119
130
|
Talaria uses **Serverpod RPC**, not REST resource URLs:
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EACb,kBAAkB,EACnB,M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;YAKP,aAAa;YAkBb,qBAAqB;IA0LnC,OAAO,CAAC,kBAAkB;IAQ1B;;;;OAIG;YACW,iBAAiB;YAoFjB,cAAc;CAuB7B"}
|
package/dist/index.js
CHANGED
|
@@ -161,6 +161,10 @@ var SegmentBuffer = class {
|
|
|
161
161
|
hasFullSnapshot() {
|
|
162
162
|
return this.events.some((e) => e.type === RRWEB_FULL_SNAPSHOT);
|
|
163
163
|
}
|
|
164
|
+
/** First FullSnapshot still queued (does not remove it). */
|
|
165
|
+
peekFullSnapshot() {
|
|
166
|
+
return this.events.find((e) => e.type === RRWEB_FULL_SNAPSHOT);
|
|
167
|
+
}
|
|
164
168
|
/**
|
|
165
169
|
* Drop leading events until Meta+FullSnapshot (or FullSnapshot alone).
|
|
166
170
|
* Returns false if no FullSnapshot is present (replay would paint blank).
|
|
@@ -390,6 +394,28 @@ function mergeReplayCaptureExtra(extra, outcome) {
|
|
|
390
394
|
};
|
|
391
395
|
}
|
|
392
396
|
|
|
397
|
+
// src/replay/paint_base_size.ts
|
|
398
|
+
function paintBaseSizeDetails(events, opts) {
|
|
399
|
+
const meta = events.find((e) => e.type === RRWEB_META);
|
|
400
|
+
const full = events.find((e) => e.type === RRWEB_FULL_SNAPSHOT);
|
|
401
|
+
const details = {
|
|
402
|
+
segmentEventTypes: events.map((e) => e.type),
|
|
403
|
+
maxUncompressedSegmentBytes: SEGMENT_SIZE_BYTES,
|
|
404
|
+
targetCompressedSegmentBytes: TARGET_COMPRESSED_SEGMENT_BYTES,
|
|
405
|
+
maxCompressedSegmentBytes: MAX_COMPRESSED_SEGMENT_BYTES
|
|
406
|
+
};
|
|
407
|
+
if (meta) {
|
|
408
|
+
details.metaEstimatedBytes = estimateJsonBytes(meta);
|
|
409
|
+
}
|
|
410
|
+
if (full) {
|
|
411
|
+
details.fullSnapshotEstimatedBytes = estimateJsonBytes(full);
|
|
412
|
+
}
|
|
413
|
+
if (opts?.fullSnapshotCompressedBytes !== void 0) {
|
|
414
|
+
details.fullSnapshotCompressedBytes = opts.fullSnapshotCompressedBytes;
|
|
415
|
+
}
|
|
416
|
+
return details;
|
|
417
|
+
}
|
|
418
|
+
|
|
393
419
|
// ../../node_modules/rrweb/dist/rrweb.js
|
|
394
420
|
var __defProp = Object.defineProperty;
|
|
395
421
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -13975,7 +14001,11 @@ var TalariaClient = class {
|
|
|
13975
14001
|
if (!this.options || !this.transport || !this.replayId) return;
|
|
13976
14002
|
if (!this.startedOnServer || this.finishedOnServer) return;
|
|
13977
14003
|
if (!this.prepareBufferForNewReplay()) {
|
|
13978
|
-
|
|
14004
|
+
const leftover = this.buffer.peekFullSnapshot();
|
|
14005
|
+
await this.abortUnusableClip(
|
|
14006
|
+
"no_full_snapshot",
|
|
14007
|
+
paintBaseSizeDetails(leftover ? [leftover] : [])
|
|
14008
|
+
);
|
|
13979
14009
|
return;
|
|
13980
14010
|
}
|
|
13981
14011
|
while (this.buffer.length > 0) {
|
|
@@ -14023,9 +14053,21 @@ var TalariaClient = class {
|
|
|
14023
14053
|
}
|
|
14024
14054
|
const { events, gzip } = fitted;
|
|
14025
14055
|
if (this.segmentIndex === 0 && !events.some((e) => e.type === RRWEB_FULL_SNAPSHOT)) {
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
|
|
14056
|
+
const leftoverFs = this.buffer.peekFullSnapshot();
|
|
14057
|
+
let compressedBytes;
|
|
14058
|
+
if (leftoverFs) {
|
|
14059
|
+
try {
|
|
14060
|
+
compressedBytes = (await compressReplayEvents([leftoverFs])).length;
|
|
14061
|
+
} catch {
|
|
14062
|
+
}
|
|
14063
|
+
}
|
|
14064
|
+
await this.abortUnusableClip(
|
|
14065
|
+
"no_full_snapshot",
|
|
14066
|
+
paintBaseSizeDetails(
|
|
14067
|
+
leftoverFs ? [...events, leftoverFs] : events,
|
|
14068
|
+
{ fullSnapshotCompressedBytes: compressedBytes }
|
|
14069
|
+
)
|
|
14070
|
+
);
|
|
14029
14071
|
return;
|
|
14030
14072
|
}
|
|
14031
14073
|
if (this.isErrorClipMode() && this.uploadedCompressedBytes + gzip.length > MAX_ERROR_CLIP_COMPRESSED_BYTES && this.segmentIndex > 0) {
|
|
@@ -14077,9 +14119,14 @@ var TalariaClient = class {
|
|
|
14077
14119
|
{ type: droppedType }
|
|
14078
14120
|
);
|
|
14079
14121
|
if (this.segmentIndex === 0 && droppedType === RRWEB_FULL_SNAPSHOT) {
|
|
14080
|
-
await this.abortUnusableClip(
|
|
14081
|
-
|
|
14082
|
-
|
|
14122
|
+
await this.abortUnusableClip(
|
|
14123
|
+
"oversized_full_snapshot",
|
|
14124
|
+
{
|
|
14125
|
+
source: "server_reject",
|
|
14126
|
+
...paintBaseSizeDetails(events),
|
|
14127
|
+
rejectedCompressedBytes: gzip.length
|
|
14128
|
+
}
|
|
14129
|
+
);
|
|
14083
14130
|
return;
|
|
14084
14131
|
}
|
|
14085
14132
|
continue;
|
|
@@ -14128,11 +14175,21 @@ var TalariaClient = class {
|
|
|
14128
14175
|
{ type: dropped?.type }
|
|
14129
14176
|
);
|
|
14130
14177
|
if (this.segmentIndex === 0 && dropped?.type === RRWEB_FULL_SNAPSHOT) {
|
|
14178
|
+
let compressedBytes;
|
|
14179
|
+
try {
|
|
14180
|
+
compressedBytes = (await compressReplayEvents([dropped])).length;
|
|
14181
|
+
} catch {
|
|
14182
|
+
}
|
|
14131
14183
|
return {
|
|
14132
14184
|
events: [],
|
|
14133
14185
|
gzip: new Uint8Array(),
|
|
14134
14186
|
abortReason: "oversized_full_snapshot",
|
|
14135
|
-
abortDetails: {
|
|
14187
|
+
abortDetails: {
|
|
14188
|
+
source: "fit_compressed_prefix",
|
|
14189
|
+
...paintBaseSizeDetails(chunk, {
|
|
14190
|
+
fullSnapshotCompressedBytes: compressedBytes
|
|
14191
|
+
})
|
|
14192
|
+
}
|
|
14136
14193
|
};
|
|
14137
14194
|
}
|
|
14138
14195
|
if (chunk.length > 1) {
|
|
@@ -14141,11 +14198,24 @@ var TalariaClient = class {
|
|
|
14141
14198
|
return this.takeFittedSegment();
|
|
14142
14199
|
}
|
|
14143
14200
|
if (this.segmentIndex === 0 && chunk.some((e) => e.type === RRWEB_FULL_SNAPSHOT) && !fitted.events.some((e) => e.type === RRWEB_FULL_SNAPSHOT)) {
|
|
14201
|
+
const full = chunk.find((e) => e.type === RRWEB_FULL_SNAPSHOT);
|
|
14202
|
+
let compressedBytes;
|
|
14203
|
+
if (full) {
|
|
14204
|
+
try {
|
|
14205
|
+
compressedBytes = (await compressReplayEvents([full])).length;
|
|
14206
|
+
} catch {
|
|
14207
|
+
}
|
|
14208
|
+
}
|
|
14144
14209
|
return {
|
|
14145
14210
|
events: [],
|
|
14146
14211
|
gzip: new Uint8Array(),
|
|
14147
14212
|
abortReason: "oversized_full_snapshot",
|
|
14148
|
-
abortDetails: {
|
|
14213
|
+
abortDetails: {
|
|
14214
|
+
source: "fit_dropped_full_snapshot",
|
|
14215
|
+
...paintBaseSizeDetails(chunk, {
|
|
14216
|
+
fullSnapshotCompressedBytes: compressedBytes
|
|
14217
|
+
})
|
|
14218
|
+
}
|
|
14149
14219
|
};
|
|
14150
14220
|
}
|
|
14151
14221
|
if (fitted.remainder.length > 0) {
|