@multiplayer-app/session-recorder-browser 0.0.11 → 0.0.13

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.
@@ -26457,7 +26457,7 @@ const MULTIPLAYER_BASE_API_URL = 'https://api.multiplayer.app';
26457
26457
  const SESSION_RESPONSE = 'multiplayer-debug-session-response';
26458
26458
  const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
26459
26459
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
26460
- const PACKAGE_VERSION_EXPORT = "0.0.11" || 0;
26460
+ const PACKAGE_VERSION_EXPORT = "0.0.13" || 0;
26461
26461
  // Regex patterns for OpenTelemetry ignore URLs
26462
26462
  const OTEL_IGNORE_URLS = [
26463
26463
  // Traces endpoint
@@ -27383,7 +27383,13 @@ class RrwebEventExporter {
27383
27383
  reconnectionAttempts: 2,
27384
27384
  transports: ['websocket'],
27385
27385
  });
27386
- this.socket.on('connect', () => {
27386
+ // this.socket.on('connect', () => {
27387
+ // this.isConnecting = false
27388
+ // this.isConnected = true
27389
+ // this.usePostMessage = false
27390
+ // this.flushQueue()
27391
+ // })
27392
+ this.socket.on('ready', () => {
27387
27393
  this.isConnecting = false;
27388
27394
  this.isConnected = true;
27389
27395
  this.usePostMessage = false;
@@ -27613,9 +27619,11 @@ class RecorderBrowserSDK {
27613
27619
  }
27614
27620
  },
27615
27621
  });
27622
+ // It will sent full snapshot again but it will fix missing first snapshot issue
27623
+ rrweb__WEBPACK_IMPORTED_MODULE_6__.record.takeFullSnapshot();
27616
27624
  if (restartTimeout > 0) {
27617
27625
  this.restartTimeout = setTimeout(() => {
27618
- this.restart(sessionId, sessionType);
27626
+ rrweb__WEBPACK_IMPORTED_MODULE_6__.record.takeFullSnapshot();
27619
27627
  }, restartTimeout);
27620
27628
  }
27621
27629
  }
@@ -28061,9 +28069,6 @@ class SessionRecorder {
28061
28069
  this._recorder.init(this._configs);
28062
28070
  }
28063
28071
  if (this.sessionId && (this.sessionState === _types__WEBPACK_IMPORTED_MODULE_3__.SessionState.started || this.sessionState === _types__WEBPACK_IMPORTED_MODULE_3__.SessionState.paused)) {
28064
- if (this.session) {
28065
- this._recorder.subscribeToSession(this.session);
28066
- }
28067
28072
  this._start();
28068
28073
  }
28069
28074
  this._registerWidgetEvents();
@@ -28345,11 +28350,12 @@ class SessionRecorder {
28345
28350
  */
28346
28351
  _start() {
28347
28352
  var _a;
28353
+ this.sessionState = _types__WEBPACK_IMPORTED_MODULE_3__.SessionState.started;
28348
28354
  this._tracer.start(this.sessionId, this.sessionType);
28349
28355
  this._recorder.start(this.sessionId, this.sessionType);
28350
- this.sessionState = _types__WEBPACK_IMPORTED_MODULE_3__.SessionState.started;
28351
28356
  if (this.session) {
28352
28357
  _eventBus__WEBPACK_IMPORTED_MODULE_6__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_4__.SESSION_STARTED_EVENT, this.session);
28358
+ this._recorder.subscribeToSession(this.session);
28353
28359
  this._sessionWidget.seconds = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.getTimeDifferenceInSeconds)((_a = this.session) === null || _a === void 0 ? void 0 : _a.startedAt);
28354
28360
  }
28355
28361
  }
@@ -28357,9 +28363,9 @@ class SessionRecorder {
28357
28363
  * Stop tracing and recording for the session
28358
28364
  */
28359
28365
  _stop() {
28366
+ this.sessionState = _types__WEBPACK_IMPORTED_MODULE_3__.SessionState.stopped;
28360
28367
  this._tracer.stop();
28361
28368
  this._recorder.stop();
28362
- this.sessionState = _types__WEBPACK_IMPORTED_MODULE_3__.SessionState.stopped;
28363
28369
  }
28364
28370
  /**
28365
28371
  * Pause the session tracing and recording
@@ -28384,7 +28390,6 @@ class SessionRecorder {
28384
28390
  this._tracer.addBatchSpanExporter(session.tempApiKey);
28385
28391
  this._apiService.updateConfigs({ apiKey: this._configs.apiKey });
28386
28392
  }
28387
- this._recorder.subscribeToSession(session);
28388
28393
  this._setSession(session);
28389
28394
  this._start();
28390
28395
  }