@multiplayer-app/session-recorder-browser 2.0.55 → 2.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -24263,7 +24263,7 @@ const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
24263
24263
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
24264
24264
  const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
24265
24265
  const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
24266
- const PACKAGE_VERSION_EXPORT = "2.0.55" || 0;
24266
+ const PACKAGE_VERSION_EXPORT = "2.0.58" || 0;
24267
24267
  // Regex patterns for OpenTelemetry ignore URLs
24268
24268
  const OTEL_IGNORE_URLS = [
24269
24269
  // Traces endpoint
@@ -27770,8 +27770,8 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_16__.Obse
27770
27770
  this._tracer.exportTraces(spans.map((s) => s.span)),
27771
27771
  this._apiService.exportEvents(sessionId, { events: events.map((e) => e.event) }),
27772
27772
  this._apiService.updateSessionAttributes(sessionId, {
27773
- startedAt: new Date(startedAt).toISOString(),
27774
- stoppedAt: new Date(stoppedAt).toISOString(),
27773
+ startedAt: this._toCrashBufferSessionIso(startedAt),
27774
+ stoppedAt: this._toCrashBufferSessionIso(stoppedAt),
27775
27775
  sessionAttributes: this.sessionAttributes,
27776
27776
  resourceAttributes: (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getNavigatorInfo)(),
27777
27777
  userAttributes: this._userAttributes || undefined,
@@ -27787,6 +27787,9 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_16__.Obse
27787
27787
  _eventBus__WEBPACK_IMPORTED_MODULE_7__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_5__.SESSION_READY_EVENT, sessionId);
27788
27788
  }
27789
27789
  }
27790
+ _toCrashBufferSessionIso(ts) {
27791
+ return new Date(ts - new Date().getTimezoneOffset() * 60 * 1000).toISOString();
27792
+ }
27790
27793
  /**
27791
27794
  * @description Check if session should be started/stopped automatically
27792
27795
  * @param {ISession} [sessionPayload]
@@ -28003,7 +28006,7 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_16__.Obse
28003
28006
  * Start tracing and recording for the session
28004
28007
  */
28005
28008
  _start() {
28006
- var _a;
28009
+ var _a, _b;
28007
28010
  this.sessionState = _types__WEBPACK_IMPORTED_MODULE_4__.SessionState.started;
28008
28011
  // eslint-disable-next-line no-self-assign
28009
28012
  this.sessionType = this.sessionType;
@@ -28012,9 +28015,11 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_16__.Obse
28012
28015
  void this._recorder.restart(this.sessionId, this.sessionType);
28013
28016
  this._navigationRecorder.start({ sessionId: this.sessionId, sessionType: this.sessionType });
28014
28017
  if (this.session) {
28015
- _eventBus__WEBPACK_IMPORTED_MODULE_7__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_5__.SESSION_STARTED_EVENT, this.session);
28016
28018
  this._socketService.subscribeToSession(this.session);
28017
28019
  this._sessionWidget.seconds = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.getTimeDifferenceInSeconds)((_a = this.session) === null || _a === void 0 ? void 0 : _a.startedAt);
28020
+ if ((_b = this.session) === null || _b === void 0 ? void 0 : _b.url) {
28021
+ _eventBus__WEBPACK_IMPORTED_MODULE_7__.recorderEventBus.emit(_config__WEBPACK_IMPORTED_MODULE_5__.SESSION_AUTO_CREATED, this.session.url);
28022
+ }
28018
28023
  }
28019
28024
  }
28020
28025
  /**