@openreplay/tracker 7.0.3 → 7.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/cjs/app/index.d.ts +1 -0
- package/cjs/app/index.js +4 -2
- package/cjs/common/interaction.d.ts +1 -0
- package/cjs/index.js +1 -1
- package/coverage/clover.xml +1412 -900
- package/coverage/coverage-final.json +22 -16
- package/coverage/lcov-report/index.html +58 -43
- package/coverage/lcov-report/main/app/guards.ts.html +42 -42
- package/coverage/lcov-report/main/app/index.html +46 -46
- package/coverage/lcov-report/main/app/index.ts.html +104 -8
- package/coverage/lcov-report/main/app/logger.ts.html +1 -1
- package/coverage/lcov-report/main/app/messages.gen.ts.html +146 -146
- package/coverage/lcov-report/main/app/observer/iframe_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/iframe_offsets.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/index.html +1 -1
- package/coverage/lcov-report/main/app/observer/shadow_root_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/observer/top_observer.ts.html +1 -1
- package/coverage/lcov-report/main/app/sanitizer.ts.html +98 -98
- package/coverage/lcov-report/main/app/session.ts.html +47 -5
- package/coverage/lcov-report/main/app/ticker.ts.html +1 -1
- package/coverage/lcov-report/main/index.html +24 -24
- package/coverage/lcov-report/main/index.ts.html +138 -6
- package/coverage/lcov-report/main/modules/Network/fetchProxy.ts.html +949 -0
- package/coverage/lcov-report/main/{vendors/finder → modules/Network}/index.html +72 -12
- package/coverage/lcov-report/main/modules/Network/index.ts.html +169 -0
- package/coverage/lcov-report/main/{app/nodes.ts.html → modules/Network/networkMessage.ts.html} +130 -115
- package/coverage/lcov-report/main/modules/Network/utils.ts.html +700 -0
- package/coverage/lcov-report/main/modules/Network/xhrProxy.ts.html +823 -0
- package/coverage/lcov-report/main/modules/attributeSender.ts.html +217 -0
- package/coverage/lcov-report/main/modules/axiosSpy.ts.html +1 -1
- package/coverage/lcov-report/main/modules/connection.ts.html +1 -1
- package/coverage/lcov-report/main/modules/console.ts.html +174 -147
- package/coverage/lcov-report/main/modules/constructedStyleSheets.ts.html +1 -1
- package/coverage/lcov-report/main/modules/cssrules.ts.html +1 -1
- package/coverage/lcov-report/main/modules/exception.ts.html +1 -1
- package/coverage/lcov-report/main/modules/featureFlags.ts.html +415 -0
- package/coverage/lcov-report/main/modules/focus.ts.html +1 -1
- package/coverage/lcov-report/main/modules/fonts.ts.html +1 -1
- package/coverage/lcov-report/main/modules/img.ts.html +6 -6
- package/coverage/lcov-report/main/modules/index.html +54 -24
- package/coverage/lcov-report/main/modules/input.ts.html +1 -1
- package/coverage/lcov-report/main/modules/mouse.ts.html +1 -1
- package/coverage/lcov-report/main/modules/network.ts.html +70 -70
- package/coverage/lcov-report/main/modules/performance.ts.html +1 -1
- package/coverage/lcov-report/main/modules/scroll.ts.html +1 -1
- package/coverage/lcov-report/main/modules/selection.ts.html +1 -1
- package/coverage/lcov-report/main/modules/tabs.ts.html +1 -1
- package/coverage/lcov-report/main/modules/timing.ts.html +1 -1
- package/coverage/lcov-report/main/modules/viewport.ts.html +1 -1
- package/coverage/lcov-report/main/utils.ts.html +97 -97
- package/coverage/lcov-report/webworker/BatchWriter.ts.html +125 -176
- package/coverage/lcov-report/webworker/MessageEncoder.gen.ts.html +88 -88
- package/coverage/lcov-report/webworker/PrimitiveEncoder.ts.html +110 -110
- package/coverage/lcov-report/webworker/QueueSender.ts.html +140 -110
- package/coverage/lcov-report/webworker/index.html +56 -71
- package/coverage/lcov-report/webworker/index.ts.html +34 -10
- package/coverage/lcov.info +2525 -1553
- package/lib/app/index.d.ts +1 -0
- package/lib/app/index.js +4 -2
- package/lib/common/interaction.d.ts +1 -0
- package/lib/common/tsconfig.tsbuildinfo +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/coverage/lcov-report/main/app/observer/observer.ts.html +0 -1282
- package/coverage/lcov-report/main/vendors/finder/finder.ts.html +0 -1381
- package/coverage/lcov-report/webworker/StringDictionary.ts.html +0 -124
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">0% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>0/69</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>0/15</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">0% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>0/10</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">0% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>0/68</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -195,141 +195,106 @@
|
|
|
195
195
|
<a name='L130'></a><a href='#L130'>130</a>
|
|
196
196
|
<a name='L131'></a><a href='#L131'>131</a>
|
|
197
197
|
<a name='L132'></a><a href='#L132'>132</a>
|
|
198
|
-
<a name='L133'></a><a href='#L133'>133</a>
|
|
199
|
-
<a name='L134'></a><a href='#L134'>134</a>
|
|
200
|
-
<a name='L135'></a><a href='#L135'>135</a>
|
|
201
|
-
<a name='L136'></a><a href='#L136'>136</a>
|
|
202
|
-
<a name='L137'></a><a href='#L137'>137</a>
|
|
203
|
-
<a name='L138'></a><a href='#L138'>138</a>
|
|
204
|
-
<a name='L139'></a><a href='#L139'>139</a>
|
|
205
|
-
<a name='L140'></a><a href='#L140'>140</a>
|
|
206
|
-
<a name='L141'></a><a href='#L141'>141</a>
|
|
207
|
-
<a name='L142'></a><a href='#L142'>142</a>
|
|
208
|
-
<a name='L143'></a><a href='#L143'>143</a>
|
|
209
|
-
<a name='L144'></a><a href='#L144'>144</a>
|
|
210
|
-
<a name='L145'></a><a href='#L145'>145</a>
|
|
211
|
-
<a name='L146'></a><a href='#L146'>146</a>
|
|
212
|
-
<a name='L147'></a><a href='#L147'>147</a>
|
|
213
|
-
<a name='L148'></a><a href='#L148'>148</a>
|
|
214
|
-
<a name='L149'></a><a href='#L149'>149</a>
|
|
215
|
-
<a name='L150'></a><a href='#L150'>150</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
198
|
+
<a name='L133'></a><a href='#L133'>133</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
216
199
|
<span class="cline-any cline-neutral"> </span>
|
|
217
|
-
<span class="cline-any cline-
|
|
218
|
-
<span class="cline-any cline-yes">1x</span>
|
|
219
|
-
<span class="cline-any cline-neutral"> </span>
|
|
220
|
-
<span class="cline-any cline-yes">1x</span>
|
|
221
|
-
<span class="cline-any cline-yes">1x</span>
|
|
222
|
-
<span class="cline-any cline-neutral"> </span>
|
|
223
|
-
<span class="cline-any cline-yes">1x</span>
|
|
224
|
-
<span class="cline-any cline-yes">11x</span>
|
|
225
|
-
<span class="cline-any cline-yes">11x</span>
|
|
226
|
-
<span class="cline-any cline-yes">11x</span>
|
|
227
|
-
<span class="cline-any cline-yes">11x</span>
|
|
228
|
-
<span class="cline-any cline-yes">11x</span>
|
|
229
|
-
<span class="cline-any cline-yes">11x</span>
|
|
230
|
-
<span class="cline-any cline-neutral"> </span>
|
|
231
|
-
<span class="cline-any cline-neutral"> </span>
|
|
232
|
-
<span class="cline-any cline-yes">11x</span>
|
|
233
|
-
<span class="cline-any cline-yes">11x</span>
|
|
234
|
-
<span class="cline-any cline-yes">11x</span>
|
|
235
|
-
<span class="cline-any cline-yes">11x</span>
|
|
236
|
-
<span class="cline-any cline-yes">11x</span>
|
|
200
|
+
<span class="cline-any cline-no"> </span>
|
|
237
201
|
<span class="cline-any cline-neutral"> </span>
|
|
238
|
-
<span class="cline-any cline-
|
|
202
|
+
<span class="cline-any cline-no"> </span>
|
|
203
|
+
<span class="cline-any cline-no"> </span>
|
|
239
204
|
<span class="cline-any cline-neutral"> </span>
|
|
205
|
+
<span class="cline-any cline-no"> </span>
|
|
206
|
+
<span class="cline-any cline-no"> </span>
|
|
207
|
+
<span class="cline-any cline-no"> </span>
|
|
208
|
+
<span class="cline-any cline-no"> </span>
|
|
209
|
+
<span class="cline-any cline-no"> </span>
|
|
210
|
+
<span class="cline-any cline-no"> </span>
|
|
240
211
|
<span class="cline-any cline-neutral"> </span>
|
|
241
212
|
<span class="cline-any cline-neutral"> </span>
|
|
242
|
-
<span class="cline-any cline-
|
|
213
|
+
<span class="cline-any cline-no"> </span>
|
|
214
|
+
<span class="cline-any cline-no"> </span>
|
|
215
|
+
<span class="cline-any cline-no"> </span>
|
|
216
|
+
<span class="cline-any cline-no"> </span>
|
|
217
|
+
<span class="cline-any cline-no"> </span>
|
|
243
218
|
<span class="cline-any cline-neutral"> </span>
|
|
219
|
+
<span class="cline-any cline-no"> </span>
|
|
244
220
|
<span class="cline-any cline-neutral"> </span>
|
|
245
|
-
<span class="cline-any cline-yes">29x</span>
|
|
246
221
|
<span class="cline-any cline-neutral"> </span>
|
|
247
222
|
<span class="cline-any cline-neutral"> </span>
|
|
223
|
+
<span class="cline-any cline-no"> </span>
|
|
248
224
|
<span class="cline-any cline-neutral"> </span>
|
|
249
|
-
<span class="cline-any cline-yes">17x</span>
|
|
250
|
-
<span class="cline-any cline-yes">51x</span>
|
|
251
225
|
<span class="cline-any cline-neutral"> </span>
|
|
252
|
-
<span class="cline-any cline-
|
|
226
|
+
<span class="cline-any cline-no"> </span>
|
|
253
227
|
<span class="cline-any cline-neutral"> </span>
|
|
254
228
|
<span class="cline-any cline-neutral"> </span>
|
|
255
229
|
<span class="cline-any cline-neutral"> </span>
|
|
256
|
-
<span class="cline-any cline-
|
|
230
|
+
<span class="cline-any cline-no"> </span>
|
|
257
231
|
<span class="cline-any cline-no"> </span>
|
|
258
232
|
<span class="cline-any cline-neutral"> </span>
|
|
233
|
+
<span class="cline-any cline-no"> </span>
|
|
259
234
|
<span class="cline-any cline-neutral"> </span>
|
|
260
235
|
<span class="cline-any cline-neutral"> </span>
|
|
261
|
-
<span class="cline-any cline-yes">12x</span>
|
|
262
|
-
<span class="cline-any cline-neutral"> </span>
|
|
263
236
|
<span class="cline-any cline-neutral"> </span>
|
|
237
|
+
<span class="cline-any cline-no"> </span>
|
|
238
|
+
<span class="cline-any cline-no"> </span>
|
|
264
239
|
<span class="cline-any cline-neutral"> </span>
|
|
265
240
|
<span class="cline-any cline-neutral"> </span>
|
|
266
241
|
<span class="cline-any cline-neutral"> </span>
|
|
242
|
+
<span class="cline-any cline-no"> </span>
|
|
267
243
|
<span class="cline-any cline-neutral"> </span>
|
|
268
244
|
<span class="cline-any cline-neutral"> </span>
|
|
269
245
|
<span class="cline-any cline-neutral"> </span>
|
|
270
|
-
<span class="cline-any cline-yes">12x</span>
|
|
271
246
|
<span class="cline-any cline-neutral"> </span>
|
|
272
|
-
<span class="cline-any cline-yes">12x</span>
|
|
273
|
-
<span class="cline-any cline-yes">12x</span>
|
|
274
|
-
<span class="cline-any cline-yes">12x</span>
|
|
275
|
-
<span class="cline-any cline-yes">12x</span>
|
|
276
247
|
<span class="cline-any cline-neutral"> </span>
|
|
277
248
|
<span class="cline-any cline-neutral"> </span>
|
|
278
249
|
<span class="cline-any cline-neutral"> </span>
|
|
279
|
-
<span class="cline-any cline-yes">16x</span>
|
|
280
|
-
<span class="cline-any cline-yes">16x</span>
|
|
281
250
|
<span class="cline-any cline-neutral"> </span>
|
|
282
251
|
<span class="cline-any cline-no"> </span>
|
|
283
252
|
<span class="cline-any cline-neutral"> </span>
|
|
284
|
-
<span class="cline-any cline-yes">16x</span>
|
|
285
|
-
<span class="cline-any cline-yes">16x</span>
|
|
286
|
-
<span class="cline-any cline-yes">16x</span>
|
|
287
|
-
<span class="cline-any cline-yes">16x</span>
|
|
288
|
-
<span class="cline-any cline-yes">16x</span>
|
|
289
|
-
<span class="cline-any cline-yes">16x</span>
|
|
290
253
|
<span class="cline-any cline-no"> </span>
|
|
291
254
|
<span class="cline-any cline-no"> </span>
|
|
292
|
-
<span class="cline-any cline-
|
|
293
|
-
<span class="cline-any cline-
|
|
294
|
-
<span class="cline-any cline-neutral"> </span>
|
|
295
|
-
<span class="cline-any cline-yes">16x</span>
|
|
296
|
-
<span class="cline-any cline-yes">16x</span>
|
|
297
|
-
<span class="cline-any cline-yes">16x</span>
|
|
298
|
-
<span class="cline-any cline-neutral"> </span>
|
|
299
|
-
<span class="cline-any cline-neutral"> </span>
|
|
300
|
-
<span class="cline-any cline-yes">16x</span>
|
|
255
|
+
<span class="cline-any cline-no"> </span>
|
|
256
|
+
<span class="cline-any cline-no"> </span>
|
|
301
257
|
<span class="cline-any cline-neutral"> </span>
|
|
302
258
|
<span class="cline-any cline-neutral"> </span>
|
|
303
|
-
<span class="cline-any cline-yes">11x</span>
|
|
304
259
|
<span class="cline-any cline-neutral"> </span>
|
|
305
|
-
<span class="cline-any cline-
|
|
260
|
+
<span class="cline-any cline-no"> </span>
|
|
261
|
+
<span class="cline-any cline-no"> </span>
|
|
306
262
|
<span class="cline-any cline-neutral"> </span>
|
|
263
|
+
<span class="cline-any cline-no"> </span>
|
|
307
264
|
<span class="cline-any cline-neutral"> </span>
|
|
265
|
+
<span class="cline-any cline-no"> </span>
|
|
266
|
+
<span class="cline-any cline-no"> </span>
|
|
267
|
+
<span class="cline-any cline-no"> </span>
|
|
268
|
+
<span class="cline-any cline-no"> </span>
|
|
269
|
+
<span class="cline-any cline-no"> </span>
|
|
270
|
+
<span class="cline-any cline-no"> </span>
|
|
271
|
+
<span class="cline-any cline-no"> </span>
|
|
272
|
+
<span class="cline-any cline-no"> </span>
|
|
308
273
|
<span class="cline-any cline-neutral"> </span>
|
|
309
|
-
<span class="cline-any cline-
|
|
310
|
-
<span class="cline-any cline-yes">2x</span>
|
|
311
|
-
<span class="cline-any cline-yes">2x</span>
|
|
274
|
+
<span class="cline-any cline-no"> </span>
|
|
312
275
|
<span class="cline-any cline-neutral"> </span>
|
|
313
|
-
<span class="cline-any cline-
|
|
276
|
+
<span class="cline-any cline-no"> </span>
|
|
277
|
+
<span class="cline-any cline-no"> </span>
|
|
278
|
+
<span class="cline-any cline-no"> </span>
|
|
314
279
|
<span class="cline-any cline-neutral"> </span>
|
|
315
280
|
<span class="cline-any cline-neutral"> </span>
|
|
281
|
+
<span class="cline-any cline-no"> </span>
|
|
316
282
|
<span class="cline-any cline-neutral"> </span>
|
|
317
|
-
<span class="cline-any cline-yes">4x</span>
|
|
318
|
-
<span class="cline-any cline-yes">1x</span>
|
|
319
283
|
<span class="cline-any cline-neutral"> </span>
|
|
320
|
-
<span class="cline-any cline-yes">4x</span>
|
|
321
284
|
<span class="cline-any cline-no"> </span>
|
|
322
285
|
<span class="cline-any cline-neutral"> </span>
|
|
323
|
-
<span class="cline-any cline-
|
|
324
|
-
<span class="cline-any cline-yes">1x</span>
|
|
325
|
-
<span class="cline-any cline-neutral"> </span>
|
|
286
|
+
<span class="cline-any cline-no"> </span>
|
|
326
287
|
<span class="cline-any cline-neutral"> </span>
|
|
327
288
|
<span class="cline-any cline-neutral"> </span>
|
|
328
289
|
<span class="cline-any cline-neutral"> </span>
|
|
290
|
+
<span class="cline-any cline-no"> </span>
|
|
291
|
+
<span class="cline-any cline-no"> </span>
|
|
329
292
|
<span class="cline-any cline-neutral"> </span>
|
|
293
|
+
<span class="cline-any cline-no"> </span>
|
|
294
|
+
<span class="cline-any cline-no"> </span>
|
|
330
295
|
<span class="cline-any cline-neutral"> </span>
|
|
331
|
-
<span class="cline-any cline-
|
|
332
|
-
<span class="cline-any cline-
|
|
296
|
+
<span class="cline-any cline-no"> </span>
|
|
297
|
+
<span class="cline-any cline-no"> </span>
|
|
333
298
|
<span class="cline-any cline-neutral"> </span>
|
|
334
299
|
<span class="cline-any cline-neutral"> </span>
|
|
335
300
|
<span class="cline-any cline-no"> </span>
|
|
@@ -350,64 +315,63 @@
|
|
|
350
315
|
<span class="cline-any cline-neutral"> </span>
|
|
351
316
|
<span class="cline-any cline-neutral"> </span>
|
|
352
317
|
<span class="cline-any cline-neutral"> </span>
|
|
353
|
-
<span class="cline-any cline-
|
|
318
|
+
<span class="cline-any cline-no"> </span>
|
|
354
319
|
<span class="cline-any cline-no"> </span>
|
|
355
320
|
<span class="cline-any cline-neutral"> </span>
|
|
356
|
-
<span class="cline-any cline-
|
|
357
|
-
<span class="cline-any cline-
|
|
321
|
+
<span class="cline-any cline-no"> </span>
|
|
322
|
+
<span class="cline-any cline-no"> </span>
|
|
323
|
+
<span class="cline-any cline-no"> </span>
|
|
358
324
|
<span class="cline-any cline-neutral"> </span>
|
|
359
325
|
<span class="cline-any cline-neutral"> </span>
|
|
360
326
|
<span class="cline-any cline-neutral"> </span>
|
|
361
|
-
<span class="cline-any cline-
|
|
327
|
+
<span class="cline-any cline-no"> </span>
|
|
362
328
|
<span class="cline-any cline-neutral"> </span>
|
|
363
329
|
<span class="cline-any cline-neutral"> </span>
|
|
364
330
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import type Message from '../common/messages.gen.js'
|
|
365
331
|
import * as Messages from '../common/messages.gen.js'
|
|
366
|
-
import MessageEncoder from './MessageEncoder.gen.js'
|
|
367
|
-
import StringDictionary from './StringDictionary.js'
|
|
332
|
+
<span class="cstat-no" title="statement not covered" >import MessageEncoder from './MessageEncoder.gen.js'</span>
|
|
368
333
|
|
|
369
|
-
const SIZE_BYTES = 3
|
|
370
|
-
const MAX_M_SIZE = (1 << (SIZE_BYTES * 8)) - 1
|
|
334
|
+
const SIZE_BYTES = <span class="cstat-no" title="statement not covered" >3</span>
|
|
335
|
+
const MAX_M_SIZE = <span class="cstat-no" title="statement not covered" >(1 << (SIZE_BYTES * 8)) - 1</span>
|
|
371
336
|
|
|
372
|
-
export default class
|
|
373
|
-
private nextIndex = 0
|
|
374
|
-
private beaconSize = 2 * 1e5
|
|
375
|
-
private encoder = new MessageEncoder(this.beaconSize)
|
|
376
|
-
private
|
|
377
|
-
private
|
|
378
|
-
private isEmpty = true
|
|
337
|
+
<span class="cstat-no" title="statement not covered" >export default class B</span>atchWriter {
|
|
338
|
+
private <span class="cstat-no" title="statement not covered" >nextIndex = 0</span>
|
|
339
|
+
private <span class="cstat-no" title="statement not covered" >beaconSize = 2 * 1e5 /</span>/ Default 200kB
|
|
340
|
+
private <span class="cstat-no" title="statement not covered" >encoder = new MessageEncoder(this.beaconSize)</span>
|
|
341
|
+
private readonly <span class="cstat-no" title="statement not covered" >sizeBuffer = new Uint8Array(SIZE_BYTES)</span>
|
|
342
|
+
private <span class="cstat-no" title="statement not covered" >isEmpty = true</span>
|
|
379
343
|
|
|
380
|
-
constructor(
|
|
381
|
-
private readonly pageNo: number
|
|
382
|
-
private timestamp: number
|
|
383
|
-
private url: string
|
|
384
|
-
private readonly onBatch: (batch: Uint8Array) => void
|
|
385
|
-
private tabId: string
|
|
344
|
+
<span class="fstat-no" title="function not covered" > constructor(</span>
|
|
345
|
+
private readonly <span class="cstat-no" title="statement not covered" >pageNo: number,</span>
|
|
346
|
+
private <span class="cstat-no" title="statement not covered" >timestamp: number,</span>
|
|
347
|
+
private <span class="cstat-no" title="statement not covered" >url: string,</span>
|
|
348
|
+
private readonly <span class="cstat-no" title="statement not covered" >onBatch: (batch: Uint8Array) => void,</span>
|
|
349
|
+
private <span class="cstat-no" title="statement not covered" >tabId: string,</span>
|
|
386
350
|
) {
|
|
387
|
-
this.prepare()
|
|
351
|
+
<span class="cstat-no" title="statement not covered" > this.prepare()</span>
|
|
388
352
|
}
|
|
389
353
|
|
|
390
|
-
private writeType(m: Message): boolean {
|
|
391
|
-
return this.encoder.uint(m[0])
|
|
354
|
+
private <span class="fstat-no" title="function not covered" >writeType(</span>m: Message): boolean {
|
|
355
|
+
<span class="cstat-no" title="statement not covered" > return this.encoder.uint(m[0])</span>
|
|
392
356
|
}
|
|
393
|
-
private writeFields(m: Message): boolean {
|
|
394
|
-
return this.encoder.encode(m)
|
|
357
|
+
private <span class="fstat-no" title="function not covered" >writeFields(</span>m: Message): boolean {
|
|
358
|
+
<span class="cstat-no" title="statement not covered" > return this.encoder.encode(m)</span>
|
|
395
359
|
}
|
|
396
|
-
private writeSizeAt(size: number, offset: number): void {
|
|
360
|
+
private <span class="fstat-no" title="function not covered" >writeSizeAt(</span>size: number, offset: number): void {
|
|
397
361
|
//boolean?
|
|
398
|
-
for (let i = 0
|
|
399
|
-
this.sizeBuffer[i] = size >> (i * 8)
|
|
362
|
+
<span class="cstat-no" title="statement not covered" > for (let i = <span class="cstat-no" title="statement not covered" >0;</span> i < SIZE_BYTES; i++) {</span>
|
|
363
|
+
<span class="cstat-no" title="statement not covered" > this.sizeBuffer[i] = size >> (i * 8) /</span>/ BigEndian
|
|
400
364
|
}
|
|
401
|
-
this.encoder.set(this.sizeBuffer, offset)
|
|
365
|
+
<span class="cstat-no" title="statement not covered" > this.encoder.set(this.sizeBuffer, offset)</span>
|
|
402
366
|
}
|
|
403
367
|
|
|
404
|
-
private prepare(): void {
|
|
405
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (!this.encoder.isEmpty) {
|
|
368
|
+
private <span class="fstat-no" title="function not covered" >prepare(</span>): void {
|
|
369
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (!this.encoder.isEmpty) {</span>
|
|
406
370
|
<span class="cstat-no" title="statement not covered" > return</span>
|
|
407
371
|
}
|
|
408
372
|
|
|
409
373
|
// MBTODO: move service-messages creation methods to webworker
|
|
410
|
-
const batchMetadata: Messages.BatchMetadata = [
|
|
374
|
+
const batchMetadata: Messages.BatchMetadata = <span class="cstat-no" title="statement not covered" >[</span>
|
|
411
375
|
Messages.Type.BatchMetadata,
|
|
412
376
|
1,
|
|
413
377
|
this.pageNo,
|
|
@@ -416,69 +380,53 @@ export default class BatchWriter {
|
|
|
416
380
|
this.url,
|
|
417
381
|
]
|
|
418
382
|
|
|
419
|
-
const tabData: Messages.TabData = [Messages.Type.TabData, this.tabId]
|
|
383
|
+
const tabData: Messages.TabData = <span class="cstat-no" title="statement not covered" >[Messages.Type.TabData, this.tabId]</span>
|
|
420
384
|
|
|
421
|
-
this.writeType(batchMetadata)
|
|
422
|
-
this.writeFields(batchMetadata)
|
|
423
|
-
this.writeWithSize(tabData as Message)
|
|
424
|
-
this.isEmpty = true
|
|
385
|
+
<span class="cstat-no" title="statement not covered" > this.writeType(batchMetadata)</span>
|
|
386
|
+
<span class="cstat-no" title="statement not covered" > this.writeFields(batchMetadata)</span>
|
|
387
|
+
<span class="cstat-no" title="statement not covered" > this.writeWithSize(tabData as Message)</span>
|
|
388
|
+
<span class="cstat-no" title="statement not covered" > this.isEmpty = true</span>
|
|
425
389
|
}
|
|
426
390
|
|
|
427
|
-
private writeWithSize(message: Message): boolean {
|
|
428
|
-
const e = this.encoder
|
|
429
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (!this.writeType(message) || !e.skip(SIZE_BYTES)) {
|
|
391
|
+
private <span class="fstat-no" title="function not covered" >writeWithSize(</span>message: Message): boolean {
|
|
392
|
+
const e = <span class="cstat-no" title="statement not covered" >this.encoder</span>
|
|
393
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (!this.writeType(message) || !e.skip(SIZE_BYTES)) {</span>
|
|
430
394
|
// app.debug.log
|
|
431
395
|
<span class="cstat-no" title="statement not covered" > return false</span>
|
|
432
396
|
}
|
|
433
|
-
const startOffset = e.getCurrentOffset()
|
|
434
|
-
const wasWritten = this.writeFields(message)
|
|
435
|
-
if (wasWritten) {
|
|
436
|
-
const endOffset = e.getCurrentOffset()
|
|
437
|
-
const size = endOffset - startOffset
|
|
438
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (size > MAX_M_SIZE) {
|
|
397
|
+
const startOffset = <span class="cstat-no" title="statement not covered" >e.getCurrentOffset()</span>
|
|
398
|
+
const wasWritten = <span class="cstat-no" title="statement not covered" >this.writeFields(message)</span>
|
|
399
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (wasWritten) {</span>
|
|
400
|
+
const endOffset = <span class="cstat-no" title="statement not covered" >e.getCurrentOffset()</span>
|
|
401
|
+
const size = <span class="cstat-no" title="statement not covered" >endOffset - startOffset</span>
|
|
402
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (size > MAX_M_SIZE) {</span>
|
|
439
403
|
<span class="cstat-no" title="statement not covered" > console.warn('OpenReplay: max message size overflow.')</span>
|
|
440
404
|
<span class="cstat-no" title="statement not covered" > return false</span>
|
|
441
405
|
}
|
|
442
|
-
this.writeSizeAt(size, startOffset - SIZE_BYTES)
|
|
406
|
+
<span class="cstat-no" title="statement not covered" > this.writeSizeAt(size, startOffset - SIZE_BYTES)</span>
|
|
443
407
|
|
|
444
|
-
e.checkpoint()
|
|
445
|
-
this.isEmpty = this.isEmpty && message[0] === Messages.Type.Timestamp
|
|
446
|
-
this.nextIndex
|
|
408
|
+
<span class="cstat-no" title="statement not covered" > e.checkpoint()</span>
|
|
409
|
+
<span class="cstat-no" title="statement not covered" > this.isEmpty = this.isEmpty && message[0] === Messages.Type.Timestamp</span>
|
|
410
|
+
<span class="cstat-no" title="statement not covered" > this.nextIndex++</span>
|
|
447
411
|
}
|
|
448
412
|
// app.debug.log
|
|
449
|
-
return wasWritten
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
private beaconSizeLimit = 1e6
|
|
453
|
-
setBeaconSizeLimit(limit: number) {
|
|
454
|
-
this.beaconSizeLimit = limit
|
|
413
|
+
<span class="cstat-no" title="statement not covered" > return wasWritten</span>
|
|
455
414
|
}
|
|
456
415
|
|
|
457
|
-
private
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
this.writeMessage([Messages.Type.StringDict, key, str])
|
|
461
|
-
}
|
|
462
|
-
return key
|
|
416
|
+
private <span class="cstat-no" title="statement not covered" >beaconSizeLimit = 1e6</span>
|
|
417
|
+
<span class="fstat-no" title="function not covered" > setBeaconSizeLimit(</span>limit: number) {
|
|
418
|
+
<span class="cstat-no" title="statement not covered" > this.beaconSizeLimit = limit</span>
|
|
463
419
|
}
|
|
464
420
|
|
|
465
|
-
writeMessage(message: Message) {
|
|
466
|
-
if (message[0] === Messages.Type.Timestamp) {
|
|
467
|
-
this.timestamp = message[1]
|
|
421
|
+
<span class="fstat-no" title="function not covered" > writeMessage(</span>message: Message) {
|
|
422
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (message[0] === Messages.Type.Timestamp) {</span>
|
|
423
|
+
<span class="cstat-no" title="statement not covered" > this.timestamp = message[1] /</span>/ .timestamp
|
|
468
424
|
}
|
|
469
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (message[0] === Messages.Type.SetPageLocation) {
|
|
425
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (message[0] === Messages.Type.SetPageLocation) {</span>
|
|
470
426
|
<span class="cstat-no" title="statement not covered" > this.url = message[1] /</span>/ .url
|
|
471
427
|
}
|
|
472
|
-
if
|
|
473
|
-
|
|
474
|
-
Messages.Type.SetNodeAttributeDict,
|
|
475
|
-
message[1],
|
|
476
|
-
this.applyDict(message[2]),
|
|
477
|
-
this.applyDict(message[3]),
|
|
478
|
-
] as Messages.SetNodeAttributeDict
|
|
479
|
-
}
|
|
480
|
-
if (this.writeWithSize(message)) {
|
|
481
|
-
return
|
|
428
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (this.writeWithSize(message)) {</span>
|
|
429
|
+
<span class="cstat-no" title="statement not covered" > return</span>
|
|
482
430
|
}
|
|
483
431
|
// buffer overflow, send already written data first then try again
|
|
484
432
|
<span class="cstat-no" title="statement not covered" > this.finaliseBatch()</span>
|
|
@@ -498,16 +446,17 @@ export default class BatchWriter {
|
|
|
498
446
|
<span class="cstat-no" title="statement not covered" > this.prepare()</span>
|
|
499
447
|
}
|
|
500
448
|
|
|
501
|
-
finaliseBatch() {
|
|
502
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (this.isEmpty) {
|
|
449
|
+
<span class="fstat-no" title="function not covered" > finaliseBatch(</span>) {
|
|
450
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (this.isEmpty) {</span>
|
|
503
451
|
<span class="cstat-no" title="statement not covered" > return</span>
|
|
504
452
|
}
|
|
505
|
-
this.
|
|
506
|
-
this.
|
|
453
|
+
const batch = <span class="cstat-no" title="statement not covered" >this.encoder.flush()</span>
|
|
454
|
+
<span class="cstat-no" title="statement not covered" > this.onBatch(batch)</span>
|
|
455
|
+
<span class="cstat-no" title="statement not covered" > this.prepare()</span>
|
|
507
456
|
}
|
|
508
457
|
|
|
509
|
-
clean() {
|
|
510
|
-
this.encoder.reset()
|
|
458
|
+
<span class="fstat-no" title="function not covered" > clean(</span>) {
|
|
459
|
+
<span class="cstat-no" title="statement not covered" > this.encoder.reset()</span>
|
|
511
460
|
}
|
|
512
461
|
}
|
|
513
462
|
</pre></td></tr></table></pre>
|
|
@@ -517,7 +466,7 @@ export default class BatchWriter {
|
|
|
517
466
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
518
467
|
Code coverage generated by
|
|
519
468
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
520
|
-
at 2023-
|
|
469
|
+
at 2023-06-28T10:44:28.733Z
|
|
521
470
|
</div>
|
|
522
471
|
<script src="../prettify.js"></script>
|
|
523
472
|
<script>
|