@sentry/replay 0.2.0-13 → 0.2.0-14

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 CHANGED
@@ -13,13 +13,13 @@ To install the stable version:
13
13
  with npm:
14
14
 
15
15
  ```shell
16
- npm install --save @sentry/browser @sentry/replay @sentry/tracing rrweb
16
+ npm install --save @sentry/browser @sentry/replay
17
17
  ```
18
18
 
19
19
  with yarn:
20
20
 
21
21
  ```shell
22
- yarn add @sentry/replay @sentry/browser @sentry/replay @sentry/tracing rrweb
22
+ yarn add @sentry/replay @sentry/browser @sentry/replay
23
23
  ```
24
24
 
25
25
  ## Setup
@@ -31,7 +31,6 @@ See the rrweb documentation for advice on configuring these values.
31
31
  ```javascript
32
32
  import * as Sentry from '@sentry/browser';
33
33
  import { SentryReplay } from '@sentry/replay';
34
- import '@sentry/tracing';
35
34
 
36
35
  Sentry.init({
37
36
  dsn: '__DSN__',
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as Sentry from '@sentry/browser';
2
2
  import { getCurrentHub, captureEvent } from '@sentry/browser';
3
- import { logger as logger$1, uuid4, addInstrumentationHandler, htmlTreeAsString } from '@sentry/utils';
3
+ import { logger as logger$1, uuid4, htmlTreeAsString, addInstrumentationHandler } from '@sentry/utils';
4
4
  import { record } from 'rrweb';
5
5
 
6
6
  /*! *****************************************************************************
@@ -319,22 +319,7 @@ function updateSessionActivity(_a) {
319
319
  return newSession;
320
320
  }
321
321
 
322
- function addInstrumentationListeners(scope, replay) {
323
- scope.addScopeListener(scopeListenerCallback.bind(replay));
324
- addInstrumentationHandler('dom', domCallback.bind(replay));
325
- addInstrumentationHandler('xhr', xhrCallback.bind(replay));
326
- addInstrumentationHandler('fetch', fetchCallback.bind(replay));
327
- }
328
- function scopeListenerCallback(scope) {
329
- //@ts-expect-error using private val
330
- var newBreadcrumb = scope._breadcrumbs[scope._breadcrumbs.length - 1];
331
- if (['fetch', 'xhr', 'sentry.event'].includes(newBreadcrumb.category) ||
332
- newBreadcrumb.category.startsWith('ui.')) {
333
- return;
334
- }
335
- this.breadcrumbs.push(__assign({ type: 'default' }, newBreadcrumb));
336
- }
337
- function domCallback(handlerData) {
322
+ function handleDom(handlerData) {
338
323
  // Taken from https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts#L112
339
324
  var target;
340
325
  var targetNode;
@@ -349,44 +334,55 @@ function domCallback(handlerData) {
349
334
  target = '<unknown>';
350
335
  }
351
336
  if (target.length === 0) {
352
- return;
337
+ return null;
353
338
  }
354
- this.breadcrumbs.push({
339
+ return {
355
340
  timestamp: new Date().getTime() / 1000,
356
341
  type: 'default',
357
342
  category: "ui.".concat(handlerData.name),
358
343
  message: target,
359
- data: {
360
- // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')
361
- nodeId: targetNode ? record.mirror.getId(targetNode) : undefined,
362
- },
363
- });
344
+ data: __assign({}, (targetNode ? { nodeId: record.mirror.getId(targetNode) } : {})),
345
+ };
364
346
  }
365
- function xhrCallback(handlerData) {
347
+
348
+ function handleFetch(handlerData) {
366
349
  // TODO: add status code into data, etc.
367
- if (handlerData.startTimestamp) {
368
- handlerData.xhr.__sentry_xhr__.startTimestamp = handlerData.startTimestamp;
350
+ if (!handlerData.endTimestamp) {
351
+ return null;
369
352
  }
370
- if (handlerData.endTimestamp) {
371
- this.spans.push({
372
- description: handlerData.args[1],
373
- op: handlerData.args[0],
374
- startTimestamp: handlerData.xhr.__sentry_xhr__.startTimestamp / 1000 ||
375
- handlerData.endTimestamp / 1000.0,
376
- endTimestamp: handlerData.endTimestamp / 1000.0,
377
- });
353
+ return {
354
+ description: handlerData.args[1],
355
+ op: handlerData.args[0],
356
+ startTimestamp: handlerData.startTimestamp / 1000,
357
+ endTimestamp: handlerData.endTimestamp / 1000,
358
+ };
359
+ }
360
+
361
+ function handleScope(scope) {
362
+ //@ts-expect-error using private val
363
+ var newBreadcrumb = scope._breadcrumbs[scope._breadcrumbs.length - 1];
364
+ if (['fetch', 'xhr', 'sentry.event'].includes(newBreadcrumb.category) ||
365
+ newBreadcrumb.category.startsWith('ui.')) {
366
+ return null;
378
367
  }
368
+ return __assign({ type: 'default' }, newBreadcrumb);
379
369
  }
380
- function fetchCallback(handlerData) {
370
+
371
+ function handleXhr(handlerData) {
381
372
  // TODO: add status code into data, etc.
382
- if (handlerData.endTimestamp) {
383
- this.spans.push({
384
- description: handlerData.args[1],
385
- op: handlerData.args[0],
386
- startTimestamp: handlerData.startTimestamp / 1000,
387
- endTimestamp: handlerData.endTimestamp / 1000,
388
- });
373
+ if (handlerData.startTimestamp) {
374
+ handlerData.xhr.__sentry_xhr__.startTimestamp = handlerData.startTimestamp;
389
375
  }
376
+ if (!handlerData.endTimestamp) {
377
+ return null;
378
+ }
379
+ return {
380
+ description: handlerData.args[1],
381
+ op: handlerData.args[0],
382
+ startTimestamp: handlerData.xhr.__sentry_xhr__.startTimestamp / 1000 ||
383
+ handlerData.endTimestamp / 1000.0,
384
+ endTimestamp: handlerData.endTimestamp / 1000.0,
385
+ };
390
386
  }
391
387
 
392
388
  var BASE_RETRY_INTERVAL = 5000;
@@ -406,25 +402,26 @@ var SentryReplay = /** @class */ (function () {
406
402
  * Buffer of rrweb events that will be serialized as JSON and saved as an attachment to a Sentry event
407
403
  */
408
404
  this.events = [];
409
- this.performanceEvents = [];
405
+ /**
406
+ * Buffer of breadcrumbs to be uploaded
407
+ */
410
408
  this.breadcrumbs = [];
409
+ /**
410
+ * Buffer of replay spans to be uploaded
411
+ */
412
+ this.replaySpans = [];
413
+ /**
414
+ * List of PerformanceEntry from PerformanceObserver
415
+ */
416
+ this.performanceEvents = [];
411
417
  /**
412
418
  * The timestamp of the first event since the last flush.
413
419
  * This is used to determine if the maximum allowed time has passed before we should flush events again.
414
420
  */
415
421
  this.initialEventTimestampSinceFlush = null;
416
- this.replaySpans = [];
417
422
  this.performanceObserver = null;
418
423
  this.retryCount = 0;
419
424
  this.retryInterval = BASE_RETRY_INTERVAL;
420
- /**
421
- * Keep a list of performance entries that will be sent with a replay
422
- */
423
- this.handlePerformanceObserver = function (list
424
- // observer: PerformanceObserver
425
- ) {
426
- _this.performanceEvents = __spreadArray(__spreadArray([], _this.performanceEvents, true), list.getEntries(), true);
427
- };
428
425
  /**
429
426
  * Handle when visibility of the page changes. (e.g. new tab is opened)
430
427
  */
@@ -458,9 +455,35 @@ var SentryReplay = /** @class */ (function () {
458
455
  // replay if it becomes visible, since no actions we care about were done
459
456
  // while it was hidden
460
457
  if (document.visibilityState !== 'visible') {
461
- _this.finishReplayEvent();
458
+ _this.flushUpdate();
462
459
  }
463
460
  };
461
+ this.handleCoreListener = function (type) { return function (handlerData) {
462
+ var handlerMap = {
463
+ scope: [handleScope, _this.breadcrumbs],
464
+ dom: [handleDom, _this.breadcrumbs],
465
+ fetch: [handleFetch, _this.replaySpans],
466
+ xhr: [handleXhr, _this.replaySpans],
467
+ };
468
+ if (!(type in handlerMap)) {
469
+ throw new Error("No handler defined for type: ".concat(type));
470
+ }
471
+ var _a = handlerMap[type], handlerFn = _a[0], handlerStore = _a[1];
472
+ var result = handlerFn(handlerData);
473
+ if (result === null) {
474
+ return;
475
+ }
476
+ handlerStore.push(result);
477
+ _this.addUpdate();
478
+ }; };
479
+ /**
480
+ * Keep a list of performance entries that will be sent with a replay
481
+ */
482
+ this.handlePerformanceObserver = function (list
483
+ // observer: PerformanceObserver
484
+ ) {
485
+ _this.performanceEvents = __spreadArray(__spreadArray([], _this.performanceEvents, true), list.getEntries(), true);
486
+ };
464
487
  this.rrwebRecordOptions = __assign({ maskAllInputs: maskAllInputs, blockClass: blockClass, ignoreClass: ignoreClass, maskTextClass: maskTextClass }, rrwebRecordOptions);
465
488
  this.options = { uploadMinDelay: uploadMinDelay, uploadMaxDelay: uploadMaxDelay, stickySession: stickySession };
466
489
  this.events = [];
@@ -485,77 +508,88 @@ var SentryReplay = /** @class */ (function () {
485
508
  };
486
509
  SentryReplay.prototype.setup = function () {
487
510
  var _this = this;
488
- var hub = Sentry.getCurrentHub();
489
- var scope = hub.getStackTop().scope;
490
- addInstrumentationListeners(scope, this);
491
511
  this.loadSession({ expiry: SESSION_IDLE_DURATION });
492
512
  // If there is no session, then something bad has happened - can't continue
493
513
  if (!this.session) {
494
514
  throw new Error('Invalid session');
495
515
  }
516
+ this.addListeners();
496
517
  // Tag all (non replay) events that get sent to Sentry with the current
497
518
  // replay ID so that we can reference them later in the UI
498
519
  Sentry.addGlobalEventProcessor(function (event) {
499
- // Do not apply replayId to the root transaction
500
- if (event.transaction === ROOT_REPLAY_NAME) {
520
+ // Do not apply replayId to the root event
521
+ if (event.message === ROOT_REPLAY_NAME) {
501
522
  return event;
502
523
  }
503
524
  event.tags = __assign(__assign({}, event.tags), { replayId: _this.session.id });
504
525
  return event;
505
526
  });
506
527
  record(__assign(__assign({}, this.rrwebRecordOptions), { emit: function (event, isCheckout) {
507
- // We want to batch uploads of replay events. Save events only if
508
- // `<uploadMinDelay>` milliseconds have elapsed since the last event
509
- // *OR* if `<uploadMaxDelay>` milliseconds have elapsed.
510
- var now = new Date().getTime();
511
- // Timestamp of the first replay event since the last flush, this gets
512
- // reset when we finish the replay event
513
- if (!_this.initialEventTimestampSinceFlush) {
514
- _this.initialEventTimestampSinceFlush = now;
515
- }
516
- // Do not finish the replay event if we receive a new replay event
517
- if (_this.timeout) {
518
- window.clearTimeout(_this.timeout);
519
- }
520
528
  // If this is false, it means session is expired, create and a new session and wait for checkout
521
529
  if (!_this.checkAndHandleExpiredSession()) {
522
530
  logger.error(new Error('Received replay event after session expired.'));
523
531
  return;
524
532
  }
525
- // We need to clear existing events on a checkout, otherwise they are
526
- // incremental event updates and should be appended
527
- if (isCheckout) {
528
- _this.events = [event];
529
- }
530
- else {
531
- _this.events.push(event);
532
- }
533
- // This event type is a fullsnapshot, we should save immediately when this occurs
534
- // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16
535
- if (event.type === 2) {
536
- // A fullsnapshot happens on initial load and if we need to start a
537
- // new replay due to idle timeout. In the latter case, a new session *should* have been started
538
- // before triggering a new checkout
539
- _this.finishReplayEvent();
540
- return;
541
- }
542
- var uploadMaxDelayExceeded = isExpired(_this.initialEventTimestampSinceFlush, _this.options.uploadMaxDelay, now);
543
- // If `uploadMaxDelayExceeded` is true, then we should finish the replay event immediately,
544
- // Otherwise schedule it to be finished in `this.options.uploadMinDelay`
545
- if (uploadMaxDelayExceeded) {
546
- logger.log('replay max delay exceeded, finishing replay event');
547
- _this.finishReplayEvent();
548
- return;
549
- }
550
- // Set timer to finish replay event and send replay attachment to
551
- // Sentry. Will be cancelled if an event happens before `uploadMinDelay`
552
- // elapses.
553
- _this.timeout = window.setTimeout(function () {
554
- logger.log('replay timeout exceeded, finishing replay event');
555
- _this.finishReplayEvent();
556
- }, _this.options.uploadMinDelay);
533
+ _this.addUpdate(function () {
534
+ // We need to clear existing events on a checkout, otherwise they are
535
+ // incremental event updates and should be appended
536
+ if (isCheckout) {
537
+ _this.events = [event];
538
+ }
539
+ else {
540
+ _this.events.push(event);
541
+ }
542
+ // This event type is a fullsnapshot, we should save immediately when this occurs
543
+ // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16
544
+ if (event.type === 2) {
545
+ // A fullsnapshot happens on initial load and if we need to start a
546
+ // new replay due to idle timeout. In the latter case, a new session *should* have been started
547
+ // before triggering a new checkout
548
+ return true;
549
+ }
550
+ return false;
551
+ });
557
552
  } }));
558
- this.addListeners();
553
+ };
554
+ /**
555
+ * We want to batch uploads of replay events. Save events only if
556
+ * `<uploadMinDelay>` milliseconds have elapsed since the last event
557
+ * *OR* if `<uploadMaxDelay>` milliseconds have elapsed.
558
+ *
559
+ * Accepts a callback to perform side-effects and returns a boolean value if we
560
+ * should flush events immediately
561
+ */
562
+ SentryReplay.prototype.addUpdate = function (cb) {
563
+ var _this = this;
564
+ var now = new Date().getTime();
565
+ // Timestamp of the first replay event since the last flush, this gets
566
+ // reset when we finish the replay event
567
+ if (!this.initialEventTimestampSinceFlush) {
568
+ this.initialEventTimestampSinceFlush = now;
569
+ }
570
+ // Do not finish the replay event if we receive a new replay event
571
+ if (this.timeout) {
572
+ window.clearTimeout(this.timeout);
573
+ }
574
+ if ((cb === null || cb === void 0 ? void 0 : cb()) === true) {
575
+ this.flushUpdate();
576
+ return;
577
+ }
578
+ var uploadMaxDelayExceeded = isExpired(this.initialEventTimestampSinceFlush, this.options.uploadMaxDelay, now);
579
+ // If `uploadMaxDelayExceeded` is true, then we should finish the replay event immediately,
580
+ // Otherwise schedule it to be finished in `this.options.uploadMinDelay`
581
+ if (uploadMaxDelayExceeded) {
582
+ logger.log('replay max delay exceeded, finishing replay event');
583
+ this.flushUpdate();
584
+ return;
585
+ }
586
+ // Set timer to finish replay event and send replay attachment to
587
+ // Sentry. Will be cancelled if an event happens before `uploadMinDelay`
588
+ // elapses.
589
+ this.timeout = window.setTimeout(function () {
590
+ logger.log('replay timeout exceeded, finishing replay event');
591
+ _this.flushUpdate();
592
+ }, this.options.uploadMinDelay);
559
593
  };
560
594
  /**
561
595
  * Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown
@@ -583,6 +617,11 @@ var SentryReplay = /** @class */ (function () {
583
617
  SentryReplay.prototype.addListeners = function () {
584
618
  var _this = this;
585
619
  document.addEventListener('visibilitychange', this.handleVisibilityChange);
620
+ // Listeners from core SDK //
621
+ var scope = Sentry.getCurrentHub().getScope();
622
+ scope.addScopeListener(this.handleCoreListener('scope'));
623
+ addInstrumentationHandler('dom', this.handleCoreListener('dom'));
624
+ // PerformanceObserver //
586
625
  if (!('PerformanceObserver' in window)) {
587
626
  return;
588
627
  }
@@ -660,9 +699,6 @@ var SentryReplay = /** @class */ (function () {
660
699
  * Returns true if session is not expired, false otherwise.
661
700
  */
662
701
  SentryReplay.prototype.checkAndHandleExpiredSession = function (expiry) {
663
- // if (!this.options.stickySession) {
664
- // return;
665
- // }
666
702
  if (expiry === void 0) { expiry = SESSION_IDLE_DURATION; }
667
703
  var oldSessionId = this.session.id;
668
704
  // This will create a new session if expired, based on expiry length
@@ -680,7 +716,7 @@ var SentryReplay = /** @class */ (function () {
680
716
  this.triggerFullSnapshot();
681
717
  return false;
682
718
  };
683
- SentryReplay.prototype.finishReplayEvent = function () {
719
+ SentryReplay.prototype.flushUpdate = function () {
684
720
  if (!this.checkAndHandleExpiredSession()) {
685
721
  logger.error(new Error('Attempting to finish replay event after session expired.'));
686
722
  }
@@ -760,9 +796,12 @@ var SentryReplay = /** @class */ (function () {
760
796
  return __generator(this, function (_a) {
761
797
  switch (_a.label) {
762
798
  case 0:
763
- // short circuit if theres no events to replay
764
- if (!this.events.length)
799
+ // short circuit if theres no events to upload
800
+ if (!this.events.length &&
801
+ !this.replaySpans.length &&
802
+ !this.breadcrumbs.length) {
765
803
  return [2 /*return*/];
804
+ }
766
805
  events = this.events;
767
806
  replaySpans = this.replaySpans;
768
807
  breadcrumbs = this.breadcrumbs;
package/dist/index.js CHANGED
@@ -342,22 +342,7 @@ function updateSessionActivity(_a) {
342
342
  return newSession;
343
343
  }
344
344
 
345
- function addInstrumentationListeners(scope, replay) {
346
- scope.addScopeListener(scopeListenerCallback.bind(replay));
347
- utils.addInstrumentationHandler('dom', domCallback.bind(replay));
348
- utils.addInstrumentationHandler('xhr', xhrCallback.bind(replay));
349
- utils.addInstrumentationHandler('fetch', fetchCallback.bind(replay));
350
- }
351
- function scopeListenerCallback(scope) {
352
- //@ts-expect-error using private val
353
- var newBreadcrumb = scope._breadcrumbs[scope._breadcrumbs.length - 1];
354
- if (['fetch', 'xhr', 'sentry.event'].includes(newBreadcrumb.category) ||
355
- newBreadcrumb.category.startsWith('ui.')) {
356
- return;
357
- }
358
- this.breadcrumbs.push(__assign({ type: 'default' }, newBreadcrumb));
359
- }
360
- function domCallback(handlerData) {
345
+ function handleDom(handlerData) {
361
346
  // Taken from https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts#L112
362
347
  var target;
363
348
  var targetNode;
@@ -372,44 +357,55 @@ function domCallback(handlerData) {
372
357
  target = '<unknown>';
373
358
  }
374
359
  if (target.length === 0) {
375
- return;
360
+ return null;
376
361
  }
377
- this.breadcrumbs.push({
362
+ return {
378
363
  timestamp: new Date().getTime() / 1000,
379
364
  type: 'default',
380
365
  category: "ui.".concat(handlerData.name),
381
366
  message: target,
382
- data: {
383
- // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')
384
- nodeId: targetNode ? rrweb.record.mirror.getId(targetNode) : undefined,
385
- },
386
- });
367
+ data: __assign({}, (targetNode ? { nodeId: rrweb.record.mirror.getId(targetNode) } : {})),
368
+ };
387
369
  }
388
- function xhrCallback(handlerData) {
370
+
371
+ function handleFetch(handlerData) {
389
372
  // TODO: add status code into data, etc.
390
- if (handlerData.startTimestamp) {
391
- handlerData.xhr.__sentry_xhr__.startTimestamp = handlerData.startTimestamp;
373
+ if (!handlerData.endTimestamp) {
374
+ return null;
392
375
  }
393
- if (handlerData.endTimestamp) {
394
- this.spans.push({
395
- description: handlerData.args[1],
396
- op: handlerData.args[0],
397
- startTimestamp: handlerData.xhr.__sentry_xhr__.startTimestamp / 1000 ||
398
- handlerData.endTimestamp / 1000.0,
399
- endTimestamp: handlerData.endTimestamp / 1000.0,
400
- });
376
+ return {
377
+ description: handlerData.args[1],
378
+ op: handlerData.args[0],
379
+ startTimestamp: handlerData.startTimestamp / 1000,
380
+ endTimestamp: handlerData.endTimestamp / 1000,
381
+ };
382
+ }
383
+
384
+ function handleScope(scope) {
385
+ //@ts-expect-error using private val
386
+ var newBreadcrumb = scope._breadcrumbs[scope._breadcrumbs.length - 1];
387
+ if (['fetch', 'xhr', 'sentry.event'].includes(newBreadcrumb.category) ||
388
+ newBreadcrumb.category.startsWith('ui.')) {
389
+ return null;
401
390
  }
391
+ return __assign({ type: 'default' }, newBreadcrumb);
402
392
  }
403
- function fetchCallback(handlerData) {
393
+
394
+ function handleXhr(handlerData) {
404
395
  // TODO: add status code into data, etc.
405
- if (handlerData.endTimestamp) {
406
- this.spans.push({
407
- description: handlerData.args[1],
408
- op: handlerData.args[0],
409
- startTimestamp: handlerData.startTimestamp / 1000,
410
- endTimestamp: handlerData.endTimestamp / 1000,
411
- });
396
+ if (handlerData.startTimestamp) {
397
+ handlerData.xhr.__sentry_xhr__.startTimestamp = handlerData.startTimestamp;
398
+ }
399
+ if (!handlerData.endTimestamp) {
400
+ return null;
412
401
  }
402
+ return {
403
+ description: handlerData.args[1],
404
+ op: handlerData.args[0],
405
+ startTimestamp: handlerData.xhr.__sentry_xhr__.startTimestamp / 1000 ||
406
+ handlerData.endTimestamp / 1000.0,
407
+ endTimestamp: handlerData.endTimestamp / 1000.0,
408
+ };
413
409
  }
414
410
 
415
411
  var BASE_RETRY_INTERVAL = 5000;
@@ -429,25 +425,26 @@ var SentryReplay = /** @class */ (function () {
429
425
  * Buffer of rrweb events that will be serialized as JSON and saved as an attachment to a Sentry event
430
426
  */
431
427
  this.events = [];
432
- this.performanceEvents = [];
428
+ /**
429
+ * Buffer of breadcrumbs to be uploaded
430
+ */
433
431
  this.breadcrumbs = [];
432
+ /**
433
+ * Buffer of replay spans to be uploaded
434
+ */
435
+ this.replaySpans = [];
436
+ /**
437
+ * List of PerformanceEntry from PerformanceObserver
438
+ */
439
+ this.performanceEvents = [];
434
440
  /**
435
441
  * The timestamp of the first event since the last flush.
436
442
  * This is used to determine if the maximum allowed time has passed before we should flush events again.
437
443
  */
438
444
  this.initialEventTimestampSinceFlush = null;
439
- this.replaySpans = [];
440
445
  this.performanceObserver = null;
441
446
  this.retryCount = 0;
442
447
  this.retryInterval = BASE_RETRY_INTERVAL;
443
- /**
444
- * Keep a list of performance entries that will be sent with a replay
445
- */
446
- this.handlePerformanceObserver = function (list
447
- // observer: PerformanceObserver
448
- ) {
449
- _this.performanceEvents = __spreadArray(__spreadArray([], _this.performanceEvents, true), list.getEntries(), true);
450
- };
451
448
  /**
452
449
  * Handle when visibility of the page changes. (e.g. new tab is opened)
453
450
  */
@@ -481,8 +478,34 @@ var SentryReplay = /** @class */ (function () {
481
478
  // replay if it becomes visible, since no actions we care about were done
482
479
  // while it was hidden
483
480
  if (document.visibilityState !== 'visible') {
484
- _this.finishReplayEvent();
481
+ _this.flushUpdate();
482
+ }
483
+ };
484
+ this.handleCoreListener = function (type) { return function (handlerData) {
485
+ var handlerMap = {
486
+ scope: [handleScope, _this.breadcrumbs],
487
+ dom: [handleDom, _this.breadcrumbs],
488
+ fetch: [handleFetch, _this.replaySpans],
489
+ xhr: [handleXhr, _this.replaySpans],
490
+ };
491
+ if (!(type in handlerMap)) {
492
+ throw new Error("No handler defined for type: ".concat(type));
493
+ }
494
+ var _a = handlerMap[type], handlerFn = _a[0], handlerStore = _a[1];
495
+ var result = handlerFn(handlerData);
496
+ if (result === null) {
497
+ return;
485
498
  }
499
+ handlerStore.push(result);
500
+ _this.addUpdate();
501
+ }; };
502
+ /**
503
+ * Keep a list of performance entries that will be sent with a replay
504
+ */
505
+ this.handlePerformanceObserver = function (list
506
+ // observer: PerformanceObserver
507
+ ) {
508
+ _this.performanceEvents = __spreadArray(__spreadArray([], _this.performanceEvents, true), list.getEntries(), true);
486
509
  };
487
510
  this.rrwebRecordOptions = __assign({ maskAllInputs: maskAllInputs, blockClass: blockClass, ignoreClass: ignoreClass, maskTextClass: maskTextClass }, rrwebRecordOptions);
488
511
  this.options = { uploadMinDelay: uploadMinDelay, uploadMaxDelay: uploadMaxDelay, stickySession: stickySession };
@@ -508,77 +531,88 @@ var SentryReplay = /** @class */ (function () {
508
531
  };
509
532
  SentryReplay.prototype.setup = function () {
510
533
  var _this = this;
511
- var hub = Sentry__namespace.getCurrentHub();
512
- var scope = hub.getStackTop().scope;
513
- addInstrumentationListeners(scope, this);
514
534
  this.loadSession({ expiry: SESSION_IDLE_DURATION });
515
535
  // If there is no session, then something bad has happened - can't continue
516
536
  if (!this.session) {
517
537
  throw new Error('Invalid session');
518
538
  }
539
+ this.addListeners();
519
540
  // Tag all (non replay) events that get sent to Sentry with the current
520
541
  // replay ID so that we can reference them later in the UI
521
542
  Sentry__namespace.addGlobalEventProcessor(function (event) {
522
- // Do not apply replayId to the root transaction
523
- if (event.transaction === ROOT_REPLAY_NAME) {
543
+ // Do not apply replayId to the root event
544
+ if (event.message === ROOT_REPLAY_NAME) {
524
545
  return event;
525
546
  }
526
547
  event.tags = __assign(__assign({}, event.tags), { replayId: _this.session.id });
527
548
  return event;
528
549
  });
529
550
  rrweb.record(__assign(__assign({}, this.rrwebRecordOptions), { emit: function (event, isCheckout) {
530
- // We want to batch uploads of replay events. Save events only if
531
- // `<uploadMinDelay>` milliseconds have elapsed since the last event
532
- // *OR* if `<uploadMaxDelay>` milliseconds have elapsed.
533
- var now = new Date().getTime();
534
- // Timestamp of the first replay event since the last flush, this gets
535
- // reset when we finish the replay event
536
- if (!_this.initialEventTimestampSinceFlush) {
537
- _this.initialEventTimestampSinceFlush = now;
538
- }
539
- // Do not finish the replay event if we receive a new replay event
540
- if (_this.timeout) {
541
- window.clearTimeout(_this.timeout);
542
- }
543
551
  // If this is false, it means session is expired, create and a new session and wait for checkout
544
552
  if (!_this.checkAndHandleExpiredSession()) {
545
553
  logger.error(new Error('Received replay event after session expired.'));
546
554
  return;
547
555
  }
548
- // We need to clear existing events on a checkout, otherwise they are
549
- // incremental event updates and should be appended
550
- if (isCheckout) {
551
- _this.events = [event];
552
- }
553
- else {
554
- _this.events.push(event);
555
- }
556
- // This event type is a fullsnapshot, we should save immediately when this occurs
557
- // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16
558
- if (event.type === 2) {
559
- // A fullsnapshot happens on initial load and if we need to start a
560
- // new replay due to idle timeout. In the latter case, a new session *should* have been started
561
- // before triggering a new checkout
562
- _this.finishReplayEvent();
563
- return;
564
- }
565
- var uploadMaxDelayExceeded = isExpired(_this.initialEventTimestampSinceFlush, _this.options.uploadMaxDelay, now);
566
- // If `uploadMaxDelayExceeded` is true, then we should finish the replay event immediately,
567
- // Otherwise schedule it to be finished in `this.options.uploadMinDelay`
568
- if (uploadMaxDelayExceeded) {
569
- logger.log('replay max delay exceeded, finishing replay event');
570
- _this.finishReplayEvent();
571
- return;
572
- }
573
- // Set timer to finish replay event and send replay attachment to
574
- // Sentry. Will be cancelled if an event happens before `uploadMinDelay`
575
- // elapses.
576
- _this.timeout = window.setTimeout(function () {
577
- logger.log('replay timeout exceeded, finishing replay event');
578
- _this.finishReplayEvent();
579
- }, _this.options.uploadMinDelay);
556
+ _this.addUpdate(function () {
557
+ // We need to clear existing events on a checkout, otherwise they are
558
+ // incremental event updates and should be appended
559
+ if (isCheckout) {
560
+ _this.events = [event];
561
+ }
562
+ else {
563
+ _this.events.push(event);
564
+ }
565
+ // This event type is a fullsnapshot, we should save immediately when this occurs
566
+ // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16
567
+ if (event.type === 2) {
568
+ // A fullsnapshot happens on initial load and if we need to start a
569
+ // new replay due to idle timeout. In the latter case, a new session *should* have been started
570
+ // before triggering a new checkout
571
+ return true;
572
+ }
573
+ return false;
574
+ });
580
575
  } }));
581
- this.addListeners();
576
+ };
577
+ /**
578
+ * We want to batch uploads of replay events. Save events only if
579
+ * `<uploadMinDelay>` milliseconds have elapsed since the last event
580
+ * *OR* if `<uploadMaxDelay>` milliseconds have elapsed.
581
+ *
582
+ * Accepts a callback to perform side-effects and returns a boolean value if we
583
+ * should flush events immediately
584
+ */
585
+ SentryReplay.prototype.addUpdate = function (cb) {
586
+ var _this = this;
587
+ var now = new Date().getTime();
588
+ // Timestamp of the first replay event since the last flush, this gets
589
+ // reset when we finish the replay event
590
+ if (!this.initialEventTimestampSinceFlush) {
591
+ this.initialEventTimestampSinceFlush = now;
592
+ }
593
+ // Do not finish the replay event if we receive a new replay event
594
+ if (this.timeout) {
595
+ window.clearTimeout(this.timeout);
596
+ }
597
+ if ((cb === null || cb === void 0 ? void 0 : cb()) === true) {
598
+ this.flushUpdate();
599
+ return;
600
+ }
601
+ var uploadMaxDelayExceeded = isExpired(this.initialEventTimestampSinceFlush, this.options.uploadMaxDelay, now);
602
+ // If `uploadMaxDelayExceeded` is true, then we should finish the replay event immediately,
603
+ // Otherwise schedule it to be finished in `this.options.uploadMinDelay`
604
+ if (uploadMaxDelayExceeded) {
605
+ logger.log('replay max delay exceeded, finishing replay event');
606
+ this.flushUpdate();
607
+ return;
608
+ }
609
+ // Set timer to finish replay event and send replay attachment to
610
+ // Sentry. Will be cancelled if an event happens before `uploadMinDelay`
611
+ // elapses.
612
+ this.timeout = window.setTimeout(function () {
613
+ logger.log('replay timeout exceeded, finishing replay event');
614
+ _this.flushUpdate();
615
+ }, this.options.uploadMinDelay);
582
616
  };
583
617
  /**
584
618
  * Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown
@@ -606,6 +640,11 @@ var SentryReplay = /** @class */ (function () {
606
640
  SentryReplay.prototype.addListeners = function () {
607
641
  var _this = this;
608
642
  document.addEventListener('visibilitychange', this.handleVisibilityChange);
643
+ // Listeners from core SDK //
644
+ var scope = Sentry__namespace.getCurrentHub().getScope();
645
+ scope.addScopeListener(this.handleCoreListener('scope'));
646
+ utils.addInstrumentationHandler('dom', this.handleCoreListener('dom'));
647
+ // PerformanceObserver //
609
648
  if (!('PerformanceObserver' in window)) {
610
649
  return;
611
650
  }
@@ -683,9 +722,6 @@ var SentryReplay = /** @class */ (function () {
683
722
  * Returns true if session is not expired, false otherwise.
684
723
  */
685
724
  SentryReplay.prototype.checkAndHandleExpiredSession = function (expiry) {
686
- // if (!this.options.stickySession) {
687
- // return;
688
- // }
689
725
  if (expiry === void 0) { expiry = SESSION_IDLE_DURATION; }
690
726
  var oldSessionId = this.session.id;
691
727
  // This will create a new session if expired, based on expiry length
@@ -703,7 +739,7 @@ var SentryReplay = /** @class */ (function () {
703
739
  this.triggerFullSnapshot();
704
740
  return false;
705
741
  };
706
- SentryReplay.prototype.finishReplayEvent = function () {
742
+ SentryReplay.prototype.flushUpdate = function () {
707
743
  if (!this.checkAndHandleExpiredSession()) {
708
744
  logger.error(new Error('Attempting to finish replay event after session expired.'));
709
745
  }
@@ -783,9 +819,12 @@ var SentryReplay = /** @class */ (function () {
783
819
  return __generator(this, function (_a) {
784
820
  switch (_a.label) {
785
821
  case 0:
786
- // short circuit if theres no events to replay
787
- if (!this.events.length)
822
+ // short circuit if theres no events to upload
823
+ if (!this.events.length &&
824
+ !this.replaySpans.length &&
825
+ !this.breadcrumbs.length) {
788
826
  return [2 /*return*/];
827
+ }
789
828
  events = this.events;
790
829
  replaySpans = this.replaySpans;
791
830
  breadcrumbs = this.breadcrumbs;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../../src/createPerformanceEntry.ts","../../src/session/constants.ts","../../src/util/isExpired.ts","../../src/util/isSessionExpired.ts","../../src/util/logger.ts","../../src/session/saveSession.ts","../../src/session/createSession.ts","../../src/session/fetchSession.ts","../../src/session/getSession.ts","../../src/session/updateSessionActivity.ts","../../src/addInstrumentationListeners.ts","../../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import { record } from 'rrweb';\n\nexport interface ReplayPerformanceEntry {\n /**\n * One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType\n */\n type: string;\n\n /**\n * A more specific description of the performance entry\n */\n name: string;\n\n /**\n * The start timestamp in seconds\n */\n start: number;\n\n /**\n * The end timestamp in seconds\n */\n end: number;\n\n /**\n * Additional unstructured data to be included\n */\n data?: Record<string, unknown>;\n}\n\ninterface MemoryInfo {\n jsHeapSizeLimit: number;\n totalJSHeapSize: number;\n usedJSHeapSize: number;\n}\n\n// Map entryType -> function to normalize data for event\nconst ENTRY_TYPES: Record<\n string,\n (entry: PerformanceEntry) => ReplayPerformanceEntry\n> = {\n resource: createResourceEntry,\n paint: createPaintEntry,\n navigation: createNavigationEntry,\n ['largest-contentful-paint']: createLargestContentfulPaint,\n};\n\nexport function createPerformanceEntries(entries: PerformanceEntry[]) {\n return entries.map(createPerformanceEntry).filter(Boolean);\n}\n\nfunction createPerformanceEntry(entry: PerformanceEntry) {\n if (ENTRY_TYPES[entry.entryType] === undefined) {\n return null;\n }\n\n return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time: number) {\n return (window.performance.timeOrigin + time) / 1000;\n}\n\nfunction createPaintEntry(entry: PerformancePaintTiming) {\n const { duration, entryType, name, startTime } = entry;\n\n const start = getAbsoluteTime(startTime);\n return {\n type: entryType,\n name,\n start,\n end: start + duration,\n };\n}\n\nfunction createNavigationEntry(entry: PerformanceNavigationTiming) {\n // TODO: There looks to be some more interesting bits in here (domComplete, domContentLoaded)\n\n const { entryType, name, domComplete, startTime, transferSize, type } = entry;\n\n return {\n type: `${entryType}.${type}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(domComplete),\n name,\n data: {\n size: transferSize,\n },\n };\n}\nfunction createResourceEntry(entry: PerformanceResourceTiming) {\n const {\n entryType,\n initiatorType,\n name,\n responseEnd,\n startTime,\n transferSize,\n } = entry;\n\n return {\n type: `${entryType}.${initiatorType}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(responseEnd),\n name,\n data: {\n size: transferSize,\n },\n };\n}\n\nfunction createLargestContentfulPaint(\n entry: PerformanceEntry & { size: number; element: Node }\n) {\n const { duration, entryType, startTime, size } = entry;\n\n const start = getAbsoluteTime(startTime);\n\n return {\n type: entryType,\n name: entryType,\n start,\n end: start + duration,\n data: {\n size,\n // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n nodeId: record.mirror.getId(entry.element as any),\n },\n };\n}\n\nexport function createMemoryEntry(memoryEntry: MemoryInfo) {\n const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;\n // we can't use getAbsoluteTime because it adds the event time to\n // window.performance.timeOrigin, so we get right now instead.\n const time = new Date().getTime() / 1000;\n return {\n type: 'memory',\n name: 'memory',\n start: time,\n end: time,\n data: {\n memory: {\n jsHeapSizeLimit,\n totalJSHeapSize,\n usedJSHeapSize,\n },\n },\n };\n}\n","export const REPLAY_SESSION_KEY = 'sentryReplaySession';\nexport const ROOT_REPLAY_NAME = 'sentry-replay';\nexport const REPLAY_EVENT_NAME = 'sentry-replay-event';\n\n// Grace period to keep a session when a user changes tabs or hides window\nexport const VISIBILITY_CHANGE_TIMEOUT = 60000; // 1 minute\n// The idle limit for a session\nexport const SESSION_IDLE_DURATION = 900000; // 15 minutes\n","/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\nexport function isExpired(\n initialTime: number,\n expiry: number,\n targetTime: number = +new Date()\n) {\n // Always expired if < 0\n if (expiry < 0) {\n return true;\n }\n\n // Never expires if == 0\n if (expiry === 0) {\n return false;\n }\n\n return initialTime + expiry <= targetTime;\n}\n","import { ReplaySession } from '@/session';\nimport { isExpired } from './isExpired';\n\n/**\n * Checks to see if session is expired\n */\nexport function isSessionExpired(\n session: ReplaySession,\n expiry: number,\n targetTime = +new Date()\n) {\n return isExpired(session.lastActivity, expiry, targetTime);\n}\n","import { logger as sentryLogger } from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from '../flags';\n\nfunction wrapLogger(logFn: typeof sentryLogger[keyof typeof sentryLogger]) {\n return function wrappedLog(...args: any[]) {\n if (!IS_DEBUG_BUILD) {\n return;\n }\n return logFn.call(sentryLogger, '[Replay]', ...args);\n };\n}\n\nconst logger = {\n ...sentryLogger,\n error: wrapLogger(sentryLogger.error),\n warn: wrapLogger(sentryLogger.warn),\n log: wrapLogger(sentryLogger.log),\n};\n\nexport { logger };\n","import { REPLAY_SESSION_KEY } from './constants';\nimport { ReplaySession } from './types';\n\nexport function saveSession(session: ReplaySession) {\n const hasSessionStorage = 'sessionStorage' in window;\n if (!hasSessionStorage) {\n return;\n }\n\n try {\n window.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n } catch {\n // this shouldn't happen\n }\n}\n","import { logger } from '@/util/logger';\nimport { saveSession } from './saveSession';\nimport type { ReplaySession } from './types';\nimport { ROOT_REPLAY_NAME } from './constants';\nimport { getCurrentHub } from '@sentry/browser';\nimport { uuid4 } from '@sentry/utils';\n\ninterface CreateSessionParams {\n /**\n * Should save to sessionStorage?\n */\n stickySession: boolean;\n}\n\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\nexport function createSession({\n stickySession = false,\n}: CreateSessionParams): ReplaySession {\n const currentDate = new Date().getTime();\n const hub = getCurrentHub();\n\n const session = {\n id: uuid4(),\n started: currentDate,\n lastActivity: currentDate,\n sequenceId: 0,\n };\n hub.captureEvent(\n {\n message: ROOT_REPLAY_NAME,\n tags: { sequenceId: session.sequenceId },\n },\n { event_id: session.id }\n );\n\n logger.log(`Creating new session: ${session.id}`);\n\n if (stickySession) {\n saveSession(session);\n }\n\n return session;\n}\n","import { REPLAY_SESSION_KEY } from './constants';\nimport { ReplaySession } from './types';\n\nexport function fetchSession(): ReplaySession | null {\n const hasSessionStorage = 'sessionStorage' in window;\n\n if (!hasSessionStorage) {\n return null;\n }\n\n try {\n return JSON.parse(window.sessionStorage.getItem(REPLAY_SESSION_KEY));\n } catch {\n return null;\n }\n}\n","import { isSessionExpired } from '@/util/isSessionExpired';\nimport { logger } from '@/util/logger';\nimport { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { ReplaySession } from './types';\n\ninterface GetSessionParams {\n /**\n * The length of time (in ms) which we will consider the session to be expired.\n */\n expiry: number;\n /**\n * Should save session to sessionStorage?\n */\n stickySession: boolean;\n\n /**\n * The current session (e.g. if stickySession is off)\n */\n currentSession?: ReplaySession;\n}\n\n/**\n * Get or create a session\n */\nexport function getSession({\n expiry,\n currentSession,\n stickySession,\n}: GetSessionParams) {\n const session = stickySession ? fetchSession() : currentSession;\n\n if (session) {\n // If there is a session, check if it is valid (e.g. \"last activity\" time should be within the \"session idle time\")\n // TODO: We should probably set a max age on this as well\n const isExpired = isSessionExpired(session, expiry);\n\n if (!isExpired) {\n logger.log(`Using existing session: ${session.id}`);\n return session;\n } else {\n logger.log(`Session has expired`);\n }\n // Otherwise continue to create a new session\n }\n\n const newSession = createSession({ stickySession });\n\n return newSession;\n}\n","import { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { saveSession } from './saveSession';\n\nexport function updateSessionActivity({\n stickySession,\n}: {\n stickySession: boolean;\n}) {\n // Nothing to do if there are no sticky sessions\n if (!stickySession) {\n return;\n }\n\n const existingSession = fetchSession();\n\n // If user manually deleted from session storage, create a new session\n if (!existingSession) {\n // TBD: There was an issue here where sessions weren't saving and this\n // caused lots of transactions to be created\n return createSession({ stickySession });\n }\n\n const newSession = {\n ...existingSession,\n lastActivity: new Date().getTime(),\n };\n\n saveSession(newSession);\n\n return newSession;\n}\n","import { record } from 'rrweb';\n\nimport { SentryReplay } from '@';\nimport { Scope } from '@sentry/hub';\nimport { addInstrumentationHandler, htmlTreeAsString } from '@sentry/utils';\n\nexport default function addInstrumentationListeners(\n scope: Scope,\n replay: SentryReplay\n) {\n scope.addScopeListener(scopeListenerCallback.bind(replay));\n addInstrumentationHandler('dom', domCallback.bind(replay));\n addInstrumentationHandler('xhr', xhrCallback.bind(replay));\n addInstrumentationHandler('fetch', fetchCallback.bind(replay));\n}\n\nfunction scopeListenerCallback(scope: Scope) {\n //@ts-expect-error using private val\n const newBreadcrumb = scope._breadcrumbs[scope._breadcrumbs.length - 1];\n\n if (\n ['fetch', 'xhr', 'sentry.event'].includes(newBreadcrumb.category) ||\n newBreadcrumb.category.startsWith('ui.')\n ) {\n return;\n }\n\n this.breadcrumbs.push({ type: 'default', ...newBreadcrumb });\n}\n\nfunction domCallback(handlerData: any) {\n // Taken from https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts#L112\n let target;\n let targetNode;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n targetNode =\n (handlerData.event.target as Node) ||\n (handlerData.event as unknown as Node);\n target = htmlTreeAsString(targetNode);\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return;\n }\n\n this.breadcrumbs.push({\n timestamp: new Date().getTime() / 1000,\n type: 'default',\n category: `ui.${handlerData.name}`,\n message: target,\n data: {\n // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n nodeId: targetNode ? record.mirror.getId(targetNode as any) : undefined,\n },\n });\n}\n\nfunction xhrCallback(handlerData: any) {\n // TODO: add status code into data, etc.\n\n if (handlerData.startTimestamp) {\n handlerData.xhr.__sentry_xhr__.startTimestamp = handlerData.startTimestamp;\n }\n if (handlerData.endTimestamp) {\n this.spans.push({\n description: handlerData.args[1],\n op: handlerData.args[0],\n startTimestamp:\n handlerData.xhr.__sentry_xhr__.startTimestamp / 1000 ||\n handlerData.endTimestamp / 1000.0,\n endTimestamp: handlerData.endTimestamp / 1000.0,\n });\n }\n}\n\nfunction fetchCallback(handlerData: any) {\n // TODO: add status code into data, etc.\n\n if (handlerData.endTimestamp) {\n this.spans.push({\n description: handlerData.args[1],\n op: handlerData.args[0],\n startTimestamp: handlerData.startTimestamp / 1000,\n endTimestamp: handlerData.endTimestamp / 1000,\n });\n }\n}\n","import * as Sentry from '@sentry/browser';\nimport { uuid4 } from '@sentry/utils';\nimport { DsnComponents, Event, Integration, Breadcrumb } from '@sentry/types';\n\nimport { record } from 'rrweb';\nimport type { eventWithTime } from 'rrweb/typings/types';\nimport {\n createPerformanceEntries,\n createMemoryEntry,\n ReplayPerformanceEntry,\n} from './createPerformanceEntry';\nimport { ReplaySession } from './session';\nimport {\n REPLAY_EVENT_NAME,\n ROOT_REPLAY_NAME,\n SESSION_IDLE_DURATION,\n VISIBILITY_CHANGE_TIMEOUT,\n} from './session/constants';\nimport { getSession } from './session/getSession';\nimport { updateSessionActivity } from './session/updateSessionActivity';\nimport { ReplaySpan } from './types';\nimport { isExpired } from './util/isExpired';\nimport { isSessionExpired } from './util/isSessionExpired';\nimport { logger } from './util/logger';\nimport { captureEvent } from '@sentry/browser';\nimport addInstrumentationListeners from './addInstrumentationListeners';\n\ntype RRWebEvent = eventWithTime;\ntype RRWebOptions = Parameters<typeof record>[0];\ninterface PluginOptions {\n /**\n * The amount of time to wait before sending a replay\n */\n uploadMinDelay?: number;\n\n /**\n * The max amount of time to wait before sending a replay\n */\n uploadMaxDelay?: number;\n\n /**\n * If false, will create a new session per pageload\n */\n stickySession?: boolean;\n}\n\ninterface SentryReplayConfiguration extends PluginOptions {\n /**\n * Options for `rrweb.recordsetup\n */\n rrwebConfig?: RRWebOptions;\n}\n\ninterface ReplayRequest {\n endpoint: string;\n events: RRWebEvent[];\n replaySpans: ReplaySpan[];\n breadcrumbs: Breadcrumb[];\n}\n\nconst BASE_RETRY_INTERVAL = 5000;\nconst MAX_RETRY_COUNT = 5;\n\nexport class SentryReplay implements Integration {\n /**\n * @inheritDoc\n */\n public static id = 'Replay';\n\n /**\n * @inheritDoc\n */\n public name: string = SentryReplay.id;\n\n /**\n * Buffer of rrweb events that will be serialized as JSON and saved as an attachment to a Sentry event\n */\n public events: RRWebEvent[] = [];\n\n public performanceEvents: PerformanceEntry[] = [];\n\n /**\n * Options to pass to `rrweb.record()`\n */\n readonly rrwebRecordOptions: RRWebOptions;\n\n readonly options: PluginOptions;\n\n /**\n * setTimeout id used for debouncing sending rrweb attachments\n */\n private timeout: number;\n\n private breadcrumbs: Breadcrumb[] = [];\n\n /**\n * The timestamp of the first event since the last flush.\n * This is used to determine if the maximum allowed time has passed before we should flush events again.\n */\n private initialEventTimestampSinceFlush: number | null = null;\n public replaySpans: ReplaySpan[] = [];\n\n private performanceObserver: PerformanceObserver | null = null;\n\n private retryCount = 0;\n private retryInterval = BASE_RETRY_INTERVAL;\n\n session: ReplaySession | undefined;\n\n static attachmentUrlFromDsn(dsn: DsnComponents, eventId: string) {\n const { host, projectId, protocol, publicKey } = dsn;\n\n const port = dsn.port !== '' ? `:${dsn.port}` : '';\n const path = dsn.path !== '' ? `/${dsn.path}` : '';\n\n return `${protocol}://${host}${port}${path}/api/${projectId}/events/${eventId}/attachments/?sentry_key=${publicKey}&sentry_version=7&sentry_client=replay`;\n }\n\n constructor({\n uploadMinDelay = 5000,\n uploadMaxDelay = 15000,\n stickySession = false, // TBD: Making this opt-in for now\n rrwebConfig: {\n maskAllInputs = true,\n blockClass = 'sr-block',\n ignoreClass = 'sr-ignore',\n maskTextClass = 'sr-mask',\n ...rrwebRecordOptions\n } = {},\n }: SentryReplayConfiguration = {}) {\n this.rrwebRecordOptions = {\n maskAllInputs,\n blockClass,\n ignoreClass,\n maskTextClass,\n ...rrwebRecordOptions,\n };\n\n this.options = { uploadMinDelay, uploadMaxDelay, stickySession };\n this.events = [];\n }\n\n setupOnce() {\n /**\n * Because we create a transaction in `setupOnce`, we can potentially create a\n * transaction before some native SDK integrations have run and applied their\n * own global event processor. An example is:\n * https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n *\n * So we do this as a workaround to wait for other global event processors to finish\n */\n window.setTimeout(() => this.setup());\n }\n\n setup() {\n const hub = Sentry.getCurrentHub();\n const { scope } = hub.getStackTop();\n\n addInstrumentationListeners(scope, this);\n\n this.loadSession({ expiry: SESSION_IDLE_DURATION });\n\n // If there is no session, then something bad has happened - can't continue\n if (!this.session) {\n throw new Error('Invalid session');\n }\n\n // Tag all (non replay) events that get sent to Sentry with the current\n // replay ID so that we can reference them later in the UI\n Sentry.addGlobalEventProcessor((event: Event) => {\n // Do not apply replayId to the root transaction\n if (event.transaction === ROOT_REPLAY_NAME) {\n return event;\n }\n\n event.tags = { ...event.tags, replayId: this.session.id };\n return event;\n });\n\n record({\n ...this.rrwebRecordOptions,\n emit: (event: RRWebEvent, isCheckout?: boolean) => {\n // We want to batch uploads of replay events. Save events only if\n // `<uploadMinDelay>` milliseconds have elapsed since the last event\n // *OR* if `<uploadMaxDelay>` milliseconds have elapsed.\n\n const now = new Date().getTime();\n\n // Timestamp of the first replay event since the last flush, this gets\n // reset when we finish the replay event\n if (!this.initialEventTimestampSinceFlush) {\n this.initialEventTimestampSinceFlush = now;\n }\n\n // Do not finish the replay event if we receive a new replay event\n if (this.timeout) {\n window.clearTimeout(this.timeout);\n }\n\n // If this is false, it means session is expired, create and a new session and wait for checkout\n if (!this.checkAndHandleExpiredSession()) {\n logger.error(\n new Error('Received replay event after session expired.')\n );\n\n return;\n }\n\n // We need to clear existing events on a checkout, otherwise they are\n // incremental event updates and should be appended\n if (isCheckout) {\n this.events = [event];\n } else {\n this.events.push(event);\n }\n\n // This event type is a fullsnapshot, we should save immediately when this occurs\n // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n if (event.type === 2) {\n // A fullsnapshot happens on initial load and if we need to start a\n // new replay due to idle timeout. In the latter case, a new session *should* have been started\n // before triggering a new checkout\n this.finishReplayEvent();\n return;\n }\n\n const uploadMaxDelayExceeded = isExpired(\n this.initialEventTimestampSinceFlush,\n this.options.uploadMaxDelay,\n now\n );\n\n // If `uploadMaxDelayExceeded` is true, then we should finish the replay event immediately,\n // Otherwise schedule it to be finished in `this.options.uploadMinDelay`\n if (uploadMaxDelayExceeded) {\n logger.log('replay max delay exceeded, finishing replay event');\n this.finishReplayEvent();\n return;\n }\n\n // Set timer to finish replay event and send replay attachment to\n // Sentry. Will be cancelled if an event happens before `uploadMinDelay`\n // elapses.\n this.timeout = window.setTimeout(() => {\n logger.log('replay timeout exceeded, finishing replay event');\n this.finishReplayEvent();\n }, this.options.uploadMinDelay);\n },\n });\n\n this.addListeners();\n }\n\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown\n */\n teardown() {\n this.removeListeners();\n }\n\n clearSession() {\n this.session = null;\n }\n\n /**\n * Loads a session from storage, or creates a new one\n */\n loadSession({ expiry }: { expiry: number }): void {\n this.session = getSession({\n expiry,\n stickySession: this.options.stickySession,\n currentSession: this.session,\n });\n }\n\n updateSession(session: Partial<ReplaySession>) {\n this.session = {\n ...this.session,\n ...session,\n };\n }\n\n addListeners() {\n document.addEventListener('visibilitychange', this.handleVisibilityChange);\n\n if (!('PerformanceObserver' in window)) {\n return;\n }\n\n this.performanceObserver = new PerformanceObserver(\n this.handlePerformanceObserver\n );\n\n // Observe almost everything for now (no mark/measure)\n [\n 'element',\n 'event',\n 'first-input',\n 'largest-contentful-paint',\n 'layout-shift',\n 'longtask',\n 'navigation',\n 'paint',\n 'resource',\n ].forEach((type) =>\n this.performanceObserver.observe({\n type,\n buffered: true,\n })\n );\n }\n\n removeListeners() {\n document.removeEventListener(\n 'visibilitychange',\n this.handleVisibilityChange\n );\n\n if (this.performanceObserver) {\n this.performanceObserver.disconnect();\n this.performanceObserver = null;\n }\n }\n\n /**\n * Keep a list of performance entries that will be sent with a replay\n */\n handlePerformanceObserver = (\n list: PerformanceObserverEntryList\n // observer: PerformanceObserver\n ) => {\n this.performanceEvents = [...this.performanceEvents, ...list.getEntries()];\n };\n\n /**\n * Handle when visibility of the page changes. (e.g. new tab is opened)\n */\n handleVisibilityChange = () => {\n const isExpired = isSessionExpired(this.session, VISIBILITY_CHANGE_TIMEOUT);\n\n if (isExpired) {\n if (document.visibilityState === 'visible') {\n // If the user has come back to the page within VISIBILITY_CHANGE_TIMEOUT\n // ms, we will re-use the existing session, otherwise create a new\n // session\n logger.log('Document has become active, but session has expired');\n this.loadSession({ expiry: VISIBILITY_CHANGE_TIMEOUT });\n this.triggerFullSnapshot();\n }\n // We definitely want to return if visibilityState is \"visible\", and I\n // think we also want to do the same when \"hidden\", as there shouldn't be\n // any action to take if user has gone idle for a long period and then\n // comes back to hide the tab. We don't trigger a full snapshot because\n // we don't want to start a new session as they immediately have hidden\n // the tab.\n return;\n }\n\n // Otherwise if session is not expired...\n\n // Update with current timestamp as the last session activity\n // Only updating session on visibility change to be conservative about\n // writing to session storage. This could be changed in the future.\n this.updateSession(\n updateSessionActivity({\n stickySession: this.options.stickySession,\n })\n );\n\n // Send replay when the page/tab becomes hidden. There is no reason to send\n // replay if it becomes visible, since no actions we care about were done\n // while it was hidden\n if (document.visibilityState !== 'visible') {\n this.finishReplayEvent();\n }\n };\n\n /**\n * Trigger rrweb to take a full snapshot which will cause this plugin to\n * create a new Replay event.\n */\n triggerFullSnapshot() {\n logger.log('Taking full rrweb snapshot');\n record.takeFullSnapshot(true);\n }\n\n /**\n * Create a span for each performance entry. The parent transaction is `this.replayEvent`.\n */\n createPerformanceSpans(entries: ReplayPerformanceEntry[]) {\n entries.forEach(({ type, start, end, name, data }) => {\n this.replaySpans.push({\n op: type,\n description: name,\n startTimestamp: start,\n endTimestamp: end,\n data,\n });\n });\n }\n\n /**\n * Observed performance events are added to `this.performanceEvents`. These\n * are included in the replay event before it is finished and sent to Sentry.\n */\n addPerformanceEntries() {\n // Copy and reset entries before processing\n const entries = [...this.performanceEvents];\n this.performanceEvents = [];\n\n // Parse the entries\n const entryEvents = createPerformanceEntries(entries);\n\n // window.performance.memory is a non-standard API and doesn't work on all browsers\n // so we check before creating the event.\n if ('memory' in window.performance) {\n // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard\n entryEvents.push(createMemoryEntry(window.performance.memory));\n }\n this.createPerformanceSpans(entryEvents);\n }\n\n /**\n *\n *\n * Returns true if session is not expired, false otherwise.\n */\n checkAndHandleExpiredSession(expiry: number = SESSION_IDLE_DURATION) {\n // if (!this.options.stickySession) {\n // return;\n // }\n\n const oldSessionId = this.session.id;\n\n // This will create a new session if expired, based on expiry length\n this.loadSession({ expiry });\n\n // Session was expired if session ids do not match\n const isExpired = oldSessionId !== this.session.id;\n\n if (!isExpired) {\n return true;\n }\n\n // TODO: We could potentially figure out a way to save the last session,\n // and produce a checkout based on a previous checkout + updates, and then\n // replay the event on top. Or maybe replay the event on top of a refresh\n // snapshot.\n\n // For now create a new snapshot\n this.triggerFullSnapshot();\n\n return false;\n }\n\n finishReplayEvent() {\n if (!this.checkAndHandleExpiredSession()) {\n logger.error(\n new Error('Attempting to finish replay event after session expired.')\n );\n }\n\n if (!this.session.id) {\n console.error(new Error('[Sentry]: No transaction, no replay'));\n return;\n }\n // TEMP: keep sending a replay event just for the duration\n captureEvent({\n message: `${REPLAY_EVENT_NAME}-${uuid4().substring(16)}`,\n tags: {\n replayId: this.session.id,\n sequenceId: this.session.sequenceId++,\n },\n });\n\n this.addPerformanceEntries();\n this.sendReplay(this.session.id);\n\n this.initialEventTimestampSinceFlush = null;\n // TBD: Alternatively we could update this after every rrweb event\n this.session.lastActivity = new Date().getTime();\n }\n\n /**\n * Determine if there is browser support for `navigator.sendBeacon`\n */\n hasSendBeacon() {\n return 'navigator' in window && 'sendBeacon' in window.navigator;\n }\n\n /**\n * Send replay attachment using either `sendBeacon()` or `fetch()`\n */\n async sendReplayRequest({\n endpoint,\n events,\n replaySpans,\n breadcrumbs,\n }: ReplayRequest) {\n const stringifiedPayload = JSON.stringify({\n recording: events,\n replaySpans: replaySpans,\n breadcrumbs: breadcrumbs,\n });\n const formData = new FormData();\n formData.append(\n 'rrweb',\n new Blob([stringifiedPayload], {\n type: 'application/json',\n }),\n `rrweb-${new Date().getTime()}.json`\n );\n\n // If sendBeacon is supported and payload is smol enough...\n if (this.hasSendBeacon() && stringifiedPayload.length <= 65536) {\n logger.log(`uploading attachment via sendBeacon()`);\n window.navigator.sendBeacon(endpoint, formData);\n return;\n }\n\n // Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads\n logger.log(`uploading attachment via fetch()`);\n await fetch(endpoint, {\n method: 'POST',\n body: formData,\n });\n }\n\n resetRetries() {\n this.retryCount = 0;\n this.retryInterval = BASE_RETRY_INTERVAL;\n }\n\n /**\n * Finalize and send the current replay event to Sentry\n */\n async sendReplay(eventId: string) {\n // short circuit if theres no events to replay\n if (!this.events.length) return;\n\n // Make a copy of the events array reference and immediately clear the\n // events member so that we do not lose new events while uploading\n // attachment.\n const events = this.events;\n const replaySpans = this.replaySpans;\n const breadcrumbs = this.breadcrumbs;\n this.replaySpans = [];\n this.breadcrumbs = [];\n this.events = [];\n\n const client = Sentry.getCurrentHub().getClient();\n const endpoint = SentryReplay.attachmentUrlFromDsn(\n client.getDsn(),\n eventId\n );\n\n try {\n await this.sendReplayRequest({\n endpoint,\n events,\n replaySpans,\n breadcrumbs,\n });\n this.resetRetries();\n return true;\n } catch (ex) {\n // we have to catch this otherwise it throws an infinite loop in Sentry\n console.error(ex);\n // If an error happened here, it's likely that uploading the attachment failed, we'll want to restore the events that failed to upload\n this.events = [...events, ...this.events];\n this.replaySpans = [...replaySpans, ...this.replaySpans];\n this.breadcrumbs = [...replaySpans, ...this.breadcrumbs];\n\n if (this.retryCount >= MAX_RETRY_COUNT) {\n this.resetRetries();\n } else {\n this.retryCount = this.retryCount + 1;\n // will retry in intervals of 5, 10, 15, 20, 25 seconds\n this.retryInterval = this.retryCount * this.retryInterval;\n setTimeout(() => this.sendReplay(eventId), this.retryInterval);\n }\n return false;\n }\n }\n}\n"],"names":["record","sentryLogger","getCurrentHub","uuid4","addInstrumentationHandler","htmlTreeAsString","Sentry","captureEvent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACO,IAAI,QAAQ,GAAG,WAAW;AACjC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC,EAAE;AACrD,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC7D,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7B,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACzF,SAAS;AACT,QAAQ,OAAO,CAAC,CAAC;AACjB,MAAK;AACL,IAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC3C,EAAC;AACD;AACO,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE;AAC7B,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;AACf,IAAI,KAAK,IAAI,CAAC,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AAC,YAAY,EAAE,CAAC;AACrB,yBAAA;AAAM,6BAAA;4BACL,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;;4BAEtC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC;AAC1D,4BAAA,UAAU,CAAC,YAAM,EAAA,OAAA,KAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA,EAAA,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;AAChE,yBAAA;AACD,wBAAA,OAAA,CAAA,CAAA,aAAO,KAAK,CAAC,CAAA;;;;;AAEhB,KAAA,CAAA;AAvgBD;;AAEG;IACW,YAAE,CAAA,EAAA,GAAG,QAAQ,CAAC;IAqgB9B,OAAC,YAAA,CAAA;AAAA,CAzgBD,EAygBC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../node_modules/.pnpm/@rollup+plugin-typescript@8.3.1_qwpalk3fl2r4saff6jvageoawu/node_modules/tslib/tslib.es6.js","../../src/createPerformanceEntry.ts","../../src/session/constants.ts","../../src/util/isExpired.ts","../../src/util/isSessionExpired.ts","../../src/util/logger.ts","../../src/session/saveSession.ts","../../src/session/createSession.ts","../../src/session/fetchSession.ts","../../src/session/getSession.ts","../../src/session/updateSessionActivity.ts","../../src/coreHandlers/handleDom.ts","../../src/coreHandlers/handleFetch.ts","../../src/coreHandlers/handleScope.ts","../../src/coreHandlers/handleXhr.ts","../../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import { record } from 'rrweb';\n\nexport interface ReplayPerformanceEntry {\n /**\n * One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType\n */\n type: string;\n\n /**\n * A more specific description of the performance entry\n */\n name: string;\n\n /**\n * The start timestamp in seconds\n */\n start: number;\n\n /**\n * The end timestamp in seconds\n */\n end: number;\n\n /**\n * Additional unstructured data to be included\n */\n data?: Record<string, unknown>;\n}\n\ninterface MemoryInfo {\n jsHeapSizeLimit: number;\n totalJSHeapSize: number;\n usedJSHeapSize: number;\n}\n\n// Map entryType -> function to normalize data for event\nconst ENTRY_TYPES: Record<\n string,\n (entry: PerformanceEntry) => ReplayPerformanceEntry\n> = {\n resource: createResourceEntry,\n paint: createPaintEntry,\n navigation: createNavigationEntry,\n ['largest-contentful-paint']: createLargestContentfulPaint,\n};\n\nexport function createPerformanceEntries(entries: PerformanceEntry[]) {\n return entries.map(createPerformanceEntry).filter(Boolean);\n}\n\nfunction createPerformanceEntry(entry: PerformanceEntry) {\n if (ENTRY_TYPES[entry.entryType] === undefined) {\n return null;\n }\n\n return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time: number) {\n return (window.performance.timeOrigin + time) / 1000;\n}\n\nfunction createPaintEntry(entry: PerformancePaintTiming) {\n const { duration, entryType, name, startTime } = entry;\n\n const start = getAbsoluteTime(startTime);\n return {\n type: entryType,\n name,\n start,\n end: start + duration,\n };\n}\n\nfunction createNavigationEntry(entry: PerformanceNavigationTiming) {\n // TODO: There looks to be some more interesting bits in here (domComplete, domContentLoaded)\n\n const { entryType, name, domComplete, startTime, transferSize, type } = entry;\n\n return {\n type: `${entryType}.${type}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(domComplete),\n name,\n data: {\n size: transferSize,\n },\n };\n}\nfunction createResourceEntry(entry: PerformanceResourceTiming) {\n const {\n entryType,\n initiatorType,\n name,\n responseEnd,\n startTime,\n transferSize,\n } = entry;\n\n return {\n type: `${entryType}.${initiatorType}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(responseEnd),\n name,\n data: {\n size: transferSize,\n },\n };\n}\n\nfunction createLargestContentfulPaint(\n entry: PerformanceEntry & { size: number; element: Node }\n) {\n const { duration, entryType, startTime, size } = entry;\n\n const start = getAbsoluteTime(startTime);\n\n return {\n type: entryType,\n name: entryType,\n start,\n end: start + duration,\n data: {\n size,\n // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n nodeId: record.mirror.getId(entry.element as any),\n },\n };\n}\n\nexport function createMemoryEntry(memoryEntry: MemoryInfo) {\n const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;\n // we can't use getAbsoluteTime because it adds the event time to\n // window.performance.timeOrigin, so we get right now instead.\n const time = new Date().getTime() / 1000;\n return {\n type: 'memory',\n name: 'memory',\n start: time,\n end: time,\n data: {\n memory: {\n jsHeapSizeLimit,\n totalJSHeapSize,\n usedJSHeapSize,\n },\n },\n };\n}\n","export const REPLAY_SESSION_KEY = 'sentryReplaySession';\nexport const ROOT_REPLAY_NAME = 'sentry-replay';\nexport const REPLAY_EVENT_NAME = 'sentry-replay-event';\n\n// Grace period to keep a session when a user changes tabs or hides window\nexport const VISIBILITY_CHANGE_TIMEOUT = 60000; // 1 minute\n// The idle limit for a session\nexport const SESSION_IDLE_DURATION = 900000; // 15 minutes\n","/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\nexport function isExpired(\n initialTime: number,\n expiry: number,\n targetTime: number = +new Date()\n) {\n // Always expired if < 0\n if (expiry < 0) {\n return true;\n }\n\n // Never expires if == 0\n if (expiry === 0) {\n return false;\n }\n\n return initialTime + expiry <= targetTime;\n}\n","import { ReplaySession } from '@/session';\nimport { isExpired } from './isExpired';\n\n/**\n * Checks to see if session is expired\n */\nexport function isSessionExpired(\n session: ReplaySession,\n expiry: number,\n targetTime = +new Date()\n) {\n return isExpired(session.lastActivity, expiry, targetTime);\n}\n","import { logger as sentryLogger } from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from '../flags';\n\nfunction wrapLogger(logFn: typeof sentryLogger[keyof typeof sentryLogger]) {\n return function wrappedLog(...args: any[]) {\n if (!IS_DEBUG_BUILD) {\n return;\n }\n return logFn.call(sentryLogger, '[Replay]', ...args);\n };\n}\n\nconst logger = {\n ...sentryLogger,\n error: wrapLogger(sentryLogger.error),\n warn: wrapLogger(sentryLogger.warn),\n log: wrapLogger(sentryLogger.log),\n};\n\nexport { logger };\n","import { REPLAY_SESSION_KEY } from './constants';\nimport { ReplaySession } from './types';\n\nexport function saveSession(session: ReplaySession) {\n const hasSessionStorage = 'sessionStorage' in window;\n if (!hasSessionStorage) {\n return;\n }\n\n try {\n window.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n } catch {\n // this shouldn't happen\n }\n}\n","import { logger } from '@/util/logger';\nimport { saveSession } from './saveSession';\nimport type { ReplaySession } from './types';\nimport { ROOT_REPLAY_NAME } from './constants';\nimport { getCurrentHub } from '@sentry/browser';\nimport { uuid4 } from '@sentry/utils';\n\ninterface CreateSessionParams {\n /**\n * Should save to sessionStorage?\n */\n stickySession: boolean;\n}\n\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\nexport function createSession({\n stickySession = false,\n}: CreateSessionParams): ReplaySession {\n const currentDate = new Date().getTime();\n const hub = getCurrentHub();\n\n const session = {\n id: uuid4(),\n started: currentDate,\n lastActivity: currentDate,\n sequenceId: 0,\n };\n hub.captureEvent(\n {\n message: ROOT_REPLAY_NAME,\n tags: { sequenceId: session.sequenceId },\n },\n { event_id: session.id }\n );\n\n logger.log(`Creating new session: ${session.id}`);\n\n if (stickySession) {\n saveSession(session);\n }\n\n return session;\n}\n","import { REPLAY_SESSION_KEY } from './constants';\nimport { ReplaySession } from './types';\n\nexport function fetchSession(): ReplaySession | null {\n const hasSessionStorage = 'sessionStorage' in window;\n\n if (!hasSessionStorage) {\n return null;\n }\n\n try {\n return JSON.parse(window.sessionStorage.getItem(REPLAY_SESSION_KEY));\n } catch {\n return null;\n }\n}\n","import { isSessionExpired } from '@/util/isSessionExpired';\nimport { logger } from '@/util/logger';\nimport { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { ReplaySession } from './types';\n\ninterface GetSessionParams {\n /**\n * The length of time (in ms) which we will consider the session to be expired.\n */\n expiry: number;\n /**\n * Should save session to sessionStorage?\n */\n stickySession: boolean;\n\n /**\n * The current session (e.g. if stickySession is off)\n */\n currentSession?: ReplaySession;\n}\n\n/**\n * Get or create a session\n */\nexport function getSession({\n expiry,\n currentSession,\n stickySession,\n}: GetSessionParams) {\n const session = stickySession ? fetchSession() : currentSession;\n\n if (session) {\n // If there is a session, check if it is valid (e.g. \"last activity\" time should be within the \"session idle time\")\n // TODO: We should probably set a max age on this as well\n const isExpired = isSessionExpired(session, expiry);\n\n if (!isExpired) {\n logger.log(`Using existing session: ${session.id}`);\n return session;\n } else {\n logger.log(`Session has expired`);\n }\n // Otherwise continue to create a new session\n }\n\n const newSession = createSession({ stickySession });\n\n return newSession;\n}\n","import { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { saveSession } from './saveSession';\n\nexport function updateSessionActivity({\n stickySession,\n}: {\n stickySession: boolean;\n}) {\n // Nothing to do if there are no sticky sessions\n if (!stickySession) {\n return;\n }\n\n const existingSession = fetchSession();\n\n // If user manually deleted from session storage, create a new session\n if (!existingSession) {\n // TBD: There was an issue here where sessions weren't saving and this\n // caused lots of transactions to be created\n return createSession({ stickySession });\n }\n\n const newSession = {\n ...existingSession,\n lastActivity: new Date().getTime(),\n };\n\n saveSession(newSession);\n\n return newSession;\n}\n","import { record } from 'rrweb';\n\nimport { htmlTreeAsString } from '@sentry/utils';\n\nexport function handleDom(handlerData: any) {\n // Taken from https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts#L112\n let target;\n let targetNode;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n targetNode =\n (handlerData.event.target as Node) ||\n (handlerData.event as unknown as Node);\n target = htmlTreeAsString(targetNode);\n } catch (e) {\n target = '<unknown>';\n }\n\n if (target.length === 0) {\n return null;\n }\n\n return {\n timestamp: new Date().getTime() / 1000,\n type: 'default',\n category: `ui.${handlerData.name}`,\n message: target,\n data: {\n // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n ...(targetNode ? { nodeId: record.mirror.getId(targetNode as any) } : {}),\n },\n };\n}\n","import { ReplaySpan } from '@/types';\n\nexport function handleFetch(handlerData: any): ReplaySpan {\n // TODO: add status code into data, etc.\n\n if (!handlerData.endTimestamp) {\n return null;\n }\n\n return {\n description: handlerData.args[1],\n op: handlerData.args[0],\n startTimestamp: handlerData.startTimestamp / 1000,\n endTimestamp: handlerData.endTimestamp / 1000,\n };\n}\n","import { Scope } from '@sentry/hub';\n\nexport function handleScope(scope: Scope) {\n //@ts-expect-error using private val\n const newBreadcrumb = scope._breadcrumbs[scope._breadcrumbs.length - 1];\n\n if (\n ['fetch', 'xhr', 'sentry.event'].includes(newBreadcrumb.category) ||\n newBreadcrumb.category.startsWith('ui.')\n ) {\n return null;\n }\n\n return { type: 'default', ...newBreadcrumb };\n}\n","import { ReplaySpan } from '@/types';\n\nexport function handleXhr(handlerData: any): ReplaySpan {\n // TODO: add status code into data, etc.\n\n if (handlerData.startTimestamp) {\n handlerData.xhr.__sentry_xhr__.startTimestamp = handlerData.startTimestamp;\n }\n\n if (!handlerData.endTimestamp) {\n return null;\n }\n\n return {\n description: handlerData.args[1],\n op: handlerData.args[0],\n startTimestamp:\n handlerData.xhr.__sentry_xhr__.startTimestamp / 1000 ||\n handlerData.endTimestamp / 1000.0,\n endTimestamp: handlerData.endTimestamp / 1000.0,\n };\n}\n","import * as Sentry from '@sentry/browser';\nimport { captureEvent } from '@sentry/browser';\nimport { addInstrumentationHandler, uuid4 } from '@sentry/utils';\nimport { DsnComponents, Event, Integration, Breadcrumb } from '@sentry/types';\n\nimport { record } from 'rrweb';\n\nimport {\n createPerformanceEntries,\n createMemoryEntry,\n ReplayPerformanceEntry,\n} from './createPerformanceEntry';\nimport { ReplaySession } from './session';\nimport {\n REPLAY_EVENT_NAME,\n ROOT_REPLAY_NAME,\n SESSION_IDLE_DURATION,\n VISIBILITY_CHANGE_TIMEOUT,\n} from './session/constants';\nimport { getSession } from './session/getSession';\nimport { updateSessionActivity } from './session/updateSessionActivity';\nimport type {\n RRWebEvent,\n RRWebOptions,\n ReplaySpan,\n ReplayRequest,\n InstrumentationType,\n} from './types';\nimport { isExpired } from './util/isExpired';\nimport { isSessionExpired } from './util/isSessionExpired';\nimport { logger } from './util/logger';\nimport { handleDom, handleScope, handleFetch, handleXhr } from './coreHandlers';\n\n/**\n * Returns true if we want to flush immediately, otherwise continue with normal batching\n */\ntype AddUpdateCallback = () => boolean;\n\ninterface PluginOptions {\n /**\n * The amount of time to wait before sending a replay\n */\n uploadMinDelay?: number;\n\n /**\n * The max amount of time to wait before sending a replay\n */\n uploadMaxDelay?: number;\n\n /**\n * If false, will create a new session per pageload\n */\n stickySession?: boolean;\n}\n\ninterface SentryReplayConfiguration extends PluginOptions {\n /**\n * Options for `rrweb.recordsetup\n */\n rrwebConfig?: RRWebOptions;\n}\n\nconst BASE_RETRY_INTERVAL = 5000;\nconst MAX_RETRY_COUNT = 5;\n\nexport class SentryReplay implements Integration {\n /**\n * @inheritDoc\n */\n public static id = 'Replay';\n\n /**\n * @inheritDoc\n */\n public name: string = SentryReplay.id;\n\n /**\n * Buffer of rrweb events that will be serialized as JSON and saved as an attachment to a Sentry event\n */\n public events: RRWebEvent[] = [];\n\n /**\n * Buffer of breadcrumbs to be uploaded\n */\n public breadcrumbs: Breadcrumb[] = [];\n\n /**\n * Buffer of replay spans to be uploaded\n */\n public replaySpans: ReplaySpan[] = [];\n\n /**\n * List of PerformanceEntry from PerformanceObserver\n */\n public performanceEvents: PerformanceEntry[] = [];\n\n /**\n * Options to pass to `rrweb.record()`\n */\n readonly rrwebRecordOptions: RRWebOptions;\n\n readonly options: PluginOptions;\n\n /**\n * setTimeout id used for debouncing sending rrweb attachments\n */\n private timeout: number;\n\n /**\n * The timestamp of the first event since the last flush.\n * This is used to determine if the maximum allowed time has passed before we should flush events again.\n */\n private initialEventTimestampSinceFlush: number | null = null;\n\n private performanceObserver: PerformanceObserver | null = null;\n\n private retryCount = 0;\n private retryInterval = BASE_RETRY_INTERVAL;\n\n session: ReplaySession | undefined;\n\n static attachmentUrlFromDsn(dsn: DsnComponents, eventId: string) {\n const { host, projectId, protocol, publicKey } = dsn;\n\n const port = dsn.port !== '' ? `:${dsn.port}` : '';\n const path = dsn.path !== '' ? `/${dsn.path}` : '';\n\n return `${protocol}://${host}${port}${path}/api/${projectId}/events/${eventId}/attachments/?sentry_key=${publicKey}&sentry_version=7&sentry_client=replay`;\n }\n\n constructor({\n uploadMinDelay = 5000,\n uploadMaxDelay = 15000,\n stickySession = false, // TBD: Making this opt-in for now\n rrwebConfig: {\n maskAllInputs = true,\n blockClass = 'sr-block',\n ignoreClass = 'sr-ignore',\n maskTextClass = 'sr-mask',\n ...rrwebRecordOptions\n } = {},\n }: SentryReplayConfiguration = {}) {\n this.rrwebRecordOptions = {\n maskAllInputs,\n blockClass,\n ignoreClass,\n maskTextClass,\n ...rrwebRecordOptions,\n };\n\n this.options = { uploadMinDelay, uploadMaxDelay, stickySession };\n this.events = [];\n }\n\n setupOnce() {\n /**\n * Because we create a transaction in `setupOnce`, we can potentially create a\n * transaction before some native SDK integrations have run and applied their\n * own global event processor. An example is:\n * https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n *\n * So we do this as a workaround to wait for other global event processors to finish\n */\n window.setTimeout(() => this.setup());\n }\n\n setup() {\n this.loadSession({ expiry: SESSION_IDLE_DURATION });\n\n // If there is no session, then something bad has happened - can't continue\n if (!this.session) {\n throw new Error('Invalid session');\n }\n\n this.addListeners();\n\n // Tag all (non replay) events that get sent to Sentry with the current\n // replay ID so that we can reference them later in the UI\n Sentry.addGlobalEventProcessor((event: Event) => {\n // Do not apply replayId to the root event\n if (event.message === ROOT_REPLAY_NAME) {\n return event;\n }\n\n event.tags = { ...event.tags, replayId: this.session.id };\n return event;\n });\n\n record({\n ...this.rrwebRecordOptions,\n emit: (event: RRWebEvent, isCheckout?: boolean) => {\n // If this is false, it means session is expired, create and a new session and wait for checkout\n if (!this.checkAndHandleExpiredSession()) {\n logger.error(\n new Error('Received replay event after session expired.')\n );\n\n return;\n }\n\n this.addUpdate(() => {\n // We need to clear existing events on a checkout, otherwise they are\n // incremental event updates and should be appended\n if (isCheckout) {\n this.events = [event];\n } else {\n this.events.push(event);\n }\n\n // This event type is a fullsnapshot, we should save immediately when this occurs\n // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n if (event.type === 2) {\n // A fullsnapshot happens on initial load and if we need to start a\n // new replay due to idle timeout. In the latter case, a new session *should* have been started\n // before triggering a new checkout\n return true;\n }\n\n return false;\n });\n },\n });\n }\n\n /**\n * We want to batch uploads of replay events. Save events only if\n * `<uploadMinDelay>` milliseconds have elapsed since the last event\n * *OR* if `<uploadMaxDelay>` milliseconds have elapsed.\n *\n * Accepts a callback to perform side-effects and returns a boolean value if we\n * should flush events immediately\n */\n addUpdate(cb?: AddUpdateCallback) {\n const now = new Date().getTime();\n\n // Timestamp of the first replay event since the last flush, this gets\n // reset when we finish the replay event\n if (!this.initialEventTimestampSinceFlush) {\n this.initialEventTimestampSinceFlush = now;\n }\n\n // Do not finish the replay event if we receive a new replay event\n if (this.timeout) {\n window.clearTimeout(this.timeout);\n }\n\n if (cb?.() === true) {\n this.flushUpdate();\n return;\n }\n\n const uploadMaxDelayExceeded = isExpired(\n this.initialEventTimestampSinceFlush,\n this.options.uploadMaxDelay,\n now\n );\n\n // If `uploadMaxDelayExceeded` is true, then we should finish the replay event immediately,\n // Otherwise schedule it to be finished in `this.options.uploadMinDelay`\n if (uploadMaxDelayExceeded) {\n logger.log('replay max delay exceeded, finishing replay event');\n this.flushUpdate();\n return;\n }\n\n // Set timer to finish replay event and send replay attachment to\n // Sentry. Will be cancelled if an event happens before `uploadMinDelay`\n // elapses.\n this.timeout = window.setTimeout(() => {\n logger.log('replay timeout exceeded, finishing replay event');\n this.flushUpdate();\n }, this.options.uploadMinDelay);\n }\n\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK does not support a teardown\n */\n teardown() {\n this.removeListeners();\n }\n\n clearSession() {\n this.session = null;\n }\n\n /**\n * Loads a session from storage, or creates a new one\n */\n loadSession({ expiry }: { expiry: number }): void {\n this.session = getSession({\n expiry,\n stickySession: this.options.stickySession,\n currentSession: this.session,\n });\n }\n\n updateSession(session: Partial<ReplaySession>) {\n this.session = {\n ...this.session,\n ...session,\n };\n }\n\n addListeners() {\n document.addEventListener('visibilitychange', this.handleVisibilityChange);\n\n // Listeners from core SDK //\n const scope = Sentry.getCurrentHub().getScope();\n scope.addScopeListener(this.handleCoreListener('scope'));\n addInstrumentationHandler('dom', this.handleCoreListener('dom'));\n\n // PerformanceObserver //\n if (!('PerformanceObserver' in window)) {\n return;\n }\n\n this.performanceObserver = new PerformanceObserver(\n this.handlePerformanceObserver\n );\n\n // Observe almost everything for now (no mark/measure)\n [\n 'element',\n 'event',\n 'first-input',\n 'largest-contentful-paint',\n 'layout-shift',\n 'longtask',\n 'navigation',\n 'paint',\n 'resource',\n ].forEach((type) =>\n this.performanceObserver.observe({\n type,\n buffered: true,\n })\n );\n }\n\n removeListeners() {\n document.removeEventListener(\n 'visibilitychange',\n this.handleVisibilityChange\n );\n\n if (this.performanceObserver) {\n this.performanceObserver.disconnect();\n this.performanceObserver = null;\n }\n }\n\n /**\n * Handle when visibility of the page changes. (e.g. new tab is opened)\n */\n handleVisibilityChange = () => {\n const isExpired = isSessionExpired(this.session, VISIBILITY_CHANGE_TIMEOUT);\n\n if (isExpired) {\n if (document.visibilityState === 'visible') {\n // If the user has come back to the page within VISIBILITY_CHANGE_TIMEOUT\n // ms, we will re-use the existing session, otherwise create a new\n // session\n logger.log('Document has become active, but session has expired');\n this.loadSession({ expiry: VISIBILITY_CHANGE_TIMEOUT });\n this.triggerFullSnapshot();\n }\n // We definitely want to return if visibilityState is \"visible\", and I\n // think we also want to do the same when \"hidden\", as there shouldn't be\n // any action to take if user has gone idle for a long period and then\n // comes back to hide the tab. We don't trigger a full snapshot because\n // we don't want to start a new session as they immediately have hidden\n // the tab.\n return;\n }\n\n // Otherwise if session is not expired...\n\n // Update with current timestamp as the last session activity\n // Only updating session on visibility change to be conservative about\n // writing to session storage. This could be changed in the future.\n this.updateSession(\n updateSessionActivity({\n stickySession: this.options.stickySession,\n })\n );\n\n // Send replay when the page/tab becomes hidden. There is no reason to send\n // replay if it becomes visible, since no actions we care about were done\n // while it was hidden\n if (document.visibilityState !== 'visible') {\n this.flushUpdate();\n }\n };\n\n handleCoreListener = (type: InstrumentationType) => (handlerData: any) => {\n const handlerMap: Record<\n InstrumentationType,\n [\n handler: InstrumentationType extends 'fetch' | 'xhr'\n ? (handlerData: any) => ReplaySpan\n : (handlerData: any) => Breadcrumb,\n store: InstrumentationType extends 'fetch' | 'xhr'\n ? ReplaySpan[]\n : Breadcrumb[]\n ]\n > = {\n scope: [handleScope, this.breadcrumbs],\n dom: [handleDom, this.breadcrumbs],\n fetch: [handleFetch, this.replaySpans],\n xhr: [handleXhr, this.replaySpans],\n };\n\n if (!(type in handlerMap)) {\n throw new Error(`No handler defined for type: ${type}`);\n }\n\n const [handlerFn, handlerStore] = handlerMap[type];\n\n const result = handlerFn(handlerData);\n\n if (result === null) {\n return;\n }\n\n handlerStore.push(result);\n\n this.addUpdate();\n };\n\n /**\n * Keep a list of performance entries that will be sent with a replay\n */\n handlePerformanceObserver = (\n list: PerformanceObserverEntryList\n // observer: PerformanceObserver\n ) => {\n this.performanceEvents = [...this.performanceEvents, ...list.getEntries()];\n };\n\n /**\n * Trigger rrweb to take a full snapshot which will cause this plugin to\n * create a new Replay event.\n */\n triggerFullSnapshot() {\n logger.log('Taking full rrweb snapshot');\n record.takeFullSnapshot(true);\n }\n\n /**\n * Create a span for each performance entry. The parent transaction is `this.replayEvent`.\n */\n createPerformanceSpans(entries: ReplayPerformanceEntry[]) {\n entries.forEach(({ type, start, end, name, data }) => {\n this.replaySpans.push({\n op: type,\n description: name,\n startTimestamp: start,\n endTimestamp: end,\n data,\n });\n });\n }\n\n /**\n * Observed performance events are added to `this.performanceEvents`. These\n * are included in the replay event before it is finished and sent to Sentry.\n */\n addPerformanceEntries() {\n // Copy and reset entries before processing\n const entries = [...this.performanceEvents];\n this.performanceEvents = [];\n\n // Parse the entries\n const entryEvents = createPerformanceEntries(entries);\n\n // window.performance.memory is a non-standard API and doesn't work on all browsers\n // so we check before creating the event.\n if ('memory' in window.performance) {\n // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard\n entryEvents.push(createMemoryEntry(window.performance.memory));\n }\n this.createPerformanceSpans(entryEvents);\n }\n\n /**\n *\n *\n * Returns true if session is not expired, false otherwise.\n */\n checkAndHandleExpiredSession(expiry: number = SESSION_IDLE_DURATION) {\n const oldSessionId = this.session.id;\n\n // This will create a new session if expired, based on expiry length\n this.loadSession({ expiry });\n\n // Session was expired if session ids do not match\n const isExpired = oldSessionId !== this.session.id;\n\n if (!isExpired) {\n return true;\n }\n\n // TODO: We could potentially figure out a way to save the last session,\n // and produce a checkout based on a previous checkout + updates, and then\n // replay the event on top. Or maybe replay the event on top of a refresh\n // snapshot.\n\n // For now create a new snapshot\n this.triggerFullSnapshot();\n\n return false;\n }\n\n flushUpdate() {\n if (!this.checkAndHandleExpiredSession()) {\n logger.error(\n new Error('Attempting to finish replay event after session expired.')\n );\n }\n\n if (!this.session.id) {\n console.error(new Error('[Sentry]: No transaction, no replay'));\n return;\n }\n // TEMP: keep sending a replay event just for the duration\n captureEvent({\n message: `${REPLAY_EVENT_NAME}-${uuid4().substring(16)}`,\n tags: {\n replayId: this.session.id,\n sequenceId: this.session.sequenceId++,\n },\n });\n\n this.addPerformanceEntries();\n this.sendReplay(this.session.id);\n\n this.initialEventTimestampSinceFlush = null;\n // TBD: Alternatively we could update this after every rrweb event\n this.session.lastActivity = new Date().getTime();\n }\n\n /**\n * Determine if there is browser support for `navigator.sendBeacon`\n */\n hasSendBeacon() {\n return 'navigator' in window && 'sendBeacon' in window.navigator;\n }\n\n /**\n * Send replay attachment using either `sendBeacon()` or `fetch()`\n */\n async sendReplayRequest({\n endpoint,\n events,\n replaySpans,\n breadcrumbs,\n }: ReplayRequest) {\n const stringifiedPayload = JSON.stringify({\n recording: events,\n replaySpans: replaySpans,\n breadcrumbs: breadcrumbs,\n });\n const formData = new FormData();\n formData.append(\n 'rrweb',\n new Blob([stringifiedPayload], {\n type: 'application/json',\n }),\n `rrweb-${new Date().getTime()}.json`\n );\n\n // If sendBeacon is supported and payload is smol enough...\n if (this.hasSendBeacon() && stringifiedPayload.length <= 65536) {\n logger.log(`uploading attachment via sendBeacon()`);\n window.navigator.sendBeacon(endpoint, formData);\n return;\n }\n\n // Otherwise use `fetch`, which *WILL* get cancelled on page reloads/unloads\n logger.log(`uploading attachment via fetch()`);\n await fetch(endpoint, {\n method: 'POST',\n body: formData,\n });\n }\n\n resetRetries() {\n this.retryCount = 0;\n this.retryInterval = BASE_RETRY_INTERVAL;\n }\n\n /**\n * Finalize and send the current replay event to Sentry\n */\n async sendReplay(eventId: string) {\n // short circuit if theres no events to upload\n if (\n !this.events.length &&\n !this.replaySpans.length &&\n !this.breadcrumbs.length\n ) {\n return;\n }\n\n // Make a copy of the events array reference and immediately clear the\n // events member so that we do not lose new events while uploading\n // attachment.\n const events = this.events;\n const replaySpans = this.replaySpans;\n const breadcrumbs = this.breadcrumbs;\n this.replaySpans = [];\n this.breadcrumbs = [];\n this.events = [];\n\n const client = Sentry.getCurrentHub().getClient();\n const endpoint = SentryReplay.attachmentUrlFromDsn(\n client.getDsn(),\n eventId\n );\n\n try {\n await this.sendReplayRequest({\n endpoint,\n events,\n replaySpans,\n breadcrumbs,\n });\n this.resetRetries();\n return true;\n } catch (ex) {\n // we have to catch this otherwise it throws an infinite loop in Sentry\n console.error(ex);\n // If an error happened here, it's likely that uploading the attachment failed, we'll want to restore the events that failed to upload\n this.events = [...events, ...this.events];\n this.replaySpans = [...replaySpans, ...this.replaySpans];\n this.breadcrumbs = [...replaySpans, ...this.breadcrumbs];\n\n if (this.retryCount >= MAX_RETRY_COUNT) {\n this.resetRetries();\n } else {\n this.retryCount = this.retryCount + 1;\n // will retry in intervals of 5, 10, 15, 20, 25 seconds\n this.retryInterval = this.retryCount * this.retryInterval;\n setTimeout(() => this.sendReplay(eventId), this.retryInterval);\n }\n return false;\n }\n }\n}\n"],"names":["record","sentryLogger","getCurrentHub","uuid4","htmlTreeAsString","Sentry","addInstrumentationHandler","captureEvent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACO,IAAI,QAAQ,GAAG,WAAW;AACjC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CA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AAA,aAAA,CAAA,EAAA,EAAA,MAAM,SAAK,IAAI,CAAC,MAAM,EAAA,IAAA,CAAC,CAAC;wBAC1C,IAAI,CAAC,WAAW,GAAO,aAAA,CAAA,aAAA,CAAA,EAAA,EAAA,WAAW,SAAK,IAAI,CAAC,WAAW,EAAA,IAAA,CAAC,CAAC;wBACzD,IAAI,CAAC,WAAW,GAAO,aAAA,CAAA,aAAA,CAAA,EAAA,EAAA,WAAW,SAAK,IAAI,CAAC,WAAW,EAAA,IAAA,CAAC,CAAC;AAEzD,wBAAA,IAAI,IAAI,CAAC,UAAU,IAAI,eAAe,EAAE;4BACtC,IAAI,CAAC,YAAY,EAAE,CAAC;AACrB,yBAAA;AAAM,6BAAA;4BACL,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;;4BAEtC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC;AAC1D,4BAAA,UAAU,CAAC,YAAM,EAAA,OAAA,KAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA,EAAA,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;AAChE,yBAAA;AACD,wBAAA,OAAA,CAAA,CAAA,aAAO,KAAK,CAAC,CAAA;;;;;AAEhB,KAAA,CAAA;AArkBD;;AAEG;IACW,YAAE,CAAA,EAAA,GAAG,QAAQ,CAAC;IAmkB9B,OAAC,YAAA,CAAA;AAAA,CAvkBD,EAukBC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/replay",
3
- "version": "0.2.0-13",
3
+ "version": "0.2.0-14",
4
4
  "description": "User replays for Sentry",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -30,21 +30,15 @@
30
30
  "url": "https://github.com/getsentry/sentry-replay/issues"
31
31
  },
32
32
  "homepage": "https://github.com/getsentry/sentry-replay#readme",
33
- "peerDependencies": {
34
- "@sentry/browser": ">=6.0.0",
35
- "@sentry/tracing": ">=6.0.0",
36
- "@sentry/utils": ">=6.0.0"
37
- },
38
33
  "devDependencies": {
39
34
  "@babel/core": "^7.17.5",
35
+ "@rollup/plugin-node-resolve": "^13.3.0",
40
36
  "@rollup/plugin-replace": "^4.0.0",
41
37
  "@rollup/plugin-typescript": "^8.3.1",
42
- "@sentry/browser": "^6.19.1",
43
- "@sentry/tracing": "^6.19.1",
44
- "@sentry/types": "^6.19.1",
45
- "@sentry/utils": "^6.19.1",
38
+ "@sentry/types": "7.0.0",
46
39
  "@types/jest": "^27.4.1",
47
40
  "@types/node": "^16.0.0",
41
+ "@types/pako": "^1.0.4",
48
42
  "@typescript-eslint/eslint-plugin": "^5.14.0",
49
43
  "@typescript-eslint/parser": "^5.14.0",
50
44
  "eslint": "^8.10.0",
@@ -56,16 +50,17 @@
56
50
  "prettier": "^2.5.1",
57
51
  "rimraf": "^3.0.2",
58
52
  "rollup": "^2.70.0",
53
+ "rollup-plugin-terser": "^7.0.2",
59
54
  "ts-jest": "^27.1.3",
60
55
  "ts-node": "^10.7.0",
61
56
  "tslib": "^2.3.1",
62
57
  "typescript": "^4.6.2"
63
58
  },
64
59
  "dependencies": {
65
- "@types/pako": "^1.0.3",
60
+ "@sentry/browser": ">=6.18.2",
61
+ "@sentry/hub": "^7.0.0",
62
+ "@sentry/utils": "^7.0.0",
66
63
  "pako": "^2.0.4",
67
- "rollup-plugin-node-resolve": "^5.2.0",
68
- "rollup-plugin-terser": "^7.0.2",
69
64
  "rrweb": "^1.1.3"
70
65
  },
71
66
  "prettier": {