@multiplayer-app/session-recorder-browser 1.3.10 → 1.3.11

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.umd.js CHANGED
@@ -23882,7 +23882,7 @@ const CONTINUOUS_DEBUGGING_TIMEOUT = 60000; // 1 minutes
23882
23882
  const DEBUG_SESSION_MAX_DURATION_SECONDS = 10 * 60 + 30; // TODO: move to shared config otel core
23883
23883
  const REMOTE_SESSION_RECORDING_START = 'remote-session-recording:start';
23884
23884
  const REMOTE_SESSION_RECORDING_STOP = 'remote-session-recording:stop';
23885
- const PACKAGE_VERSION_EXPORT = "1.3.10" || 0;
23885
+ const PACKAGE_VERSION_EXPORT = "1.3.11" || 0;
23886
23886
  // Regex patterns for OpenTelemetry ignore URLs
23887
23887
  const OTEL_IGNORE_URLS = [
23888
23888
  // Traces endpoint
@@ -25928,11 +25928,10 @@ class SocketService extends lib0_observable__WEBPACK_IMPORTED_MODULE_3__.Observa
25928
25928
  _services_messaging_service__WEBPACK_IMPORTED_MODULE_1__["default"].sendMessage(action, data);
25929
25929
  }
25930
25930
  emitSocketEvent(name, data) {
25931
- var _a;
25932
25931
  if (this.usePostMessage) {
25933
25932
  this.sendViaPostMessage(name, data);
25934
25933
  }
25935
- else if ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.connected) {
25934
+ else if (this.socket && this.isConnected) {
25936
25935
  this.socket.emit(name, data);
25937
25936
  }
25938
25937
  else {
@@ -25941,15 +25940,14 @@ class SocketService extends lib0_observable__WEBPACK_IMPORTED_MODULE_3__.Observa
25941
25940
  }
25942
25941
  }
25943
25942
  flushQueue() {
25944
- var _a, _b;
25945
- while (this.queue.length > 0 && (this.usePostMessage || ((_a = this.socket) === null || _a === void 0 ? void 0 : _a.connected))) {
25943
+ while (this.queue.length > 0 && (this.usePostMessage || this.isConnected)) {
25946
25944
  const event = this.queue.shift();
25947
25945
  if (!event)
25948
25946
  continue;
25949
25947
  if (this.usePostMessage) {
25950
25948
  this.sendViaPostMessage(event.name, event.data);
25951
25949
  }
25952
- else if ((_b = this.socket) === null || _b === void 0 ? void 0 : _b.connected) {
25950
+ else if (this.socket && this.isConnected) {
25953
25951
  this.socket.emit(event.name, event.data);
25954
25952
  }
25955
25953
  }
@@ -26099,6 +26097,12 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_14__.Obse
26099
26097
  set sessionAttributes(attributes) {
26100
26098
  this._sessionAttributes = attributes;
26101
26099
  }
26100
+ get userAttributes() {
26101
+ return this._userAttributes;
26102
+ }
26103
+ set userAttributes(userAttributes) {
26104
+ this._userAttributes = userAttributes;
26105
+ }
26102
26106
  get error() {
26103
26107
  return this._error;
26104
26108
  }
@@ -26129,7 +26133,6 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_14__.Obse
26129
26133
  this._recorder = new _rrweb__WEBPACK_IMPORTED_MODULE_1__.RecorderBrowserSDK();
26130
26134
  this._sessionWidget = new _sessionWidget__WEBPACK_IMPORTED_MODULE_8__.SessionWidget();
26131
26135
  this._navigationRecorder = new _navigation__WEBPACK_IMPORTED_MODULE_13__.NavigationRecorder();
26132
- this._userAttributes = undefined;
26133
26136
  this._startRequestController = null;
26134
26137
  this._isInitialized = false;
26135
26138
  // Session ID and state are stored in localStorage
@@ -26138,6 +26141,7 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_14__.Obse
26138
26141
  this._sessionState = null;
26139
26142
  this._session = null;
26140
26143
  this._sessionAttributes = null;
26144
+ this._userAttributes = null;
26141
26145
  /**
26142
26146
  * Error message getter and setter
26143
26147
  */
@@ -26346,6 +26350,9 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_14__.Obse
26346
26350
  * @param userAttributes - the user attributes to set
26347
26351
  */
26348
26352
  setUserAttributes(userAttributes) {
26353
+ if (!this._userAttributes && !userAttributes) {
26354
+ return;
26355
+ }
26349
26356
  this._userAttributes = userAttributes;
26350
26357
  this._socketService.setUser(this._userAttributes);
26351
26358
  }
@@ -26544,8 +26551,8 @@ class SessionRecorder extends lib0_observable__WEBPACK_IMPORTED_MODULE_14__.Obse
26544
26551
  const payload = {
26545
26552
  sessionAttributes: this.sessionAttributes,
26546
26553
  resourceAttributes: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.getNavigatorInfo)(),
26547
- userAttributes: this._userAttributes,
26548
- name: this._getSessionName()
26554
+ name: this._getSessionName(),
26555
+ ...(this._userAttributes ? { userAttributes: this._userAttributes } : {}),
26549
26556
  };
26550
26557
  const request = !this.continuousRecording ?
26551
26558
  payload : { debugSessionData: payload };