@coralogix/browser 2.11.0 → 2.11.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.11.1 (2025-11-24)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - Trigger snapshot context when setUserContext is called
6
+
1
7
  ## 2.11.0 (2025-11-23)
2
8
 
3
9
  ### 🚀 Features
package/index.esm2.js CHANGED
@@ -3968,7 +3968,7 @@ function resolveUrlBlueprinters(urlBlueprinters) {
3968
3968
  return resolvedUrlBlueprinters;
3969
3969
  }
3970
3970
 
3971
- var SDK_VERSION = '2.11.0';
3971
+ var SDK_VERSION = '2.11.1';
3972
3972
 
3973
3973
  function shouldDropEvent(cxRumEvent, options) {
3974
3974
  if (isDocumentErrorWithoutMessage(cxRumEvent)) {
@@ -4378,6 +4378,10 @@ var CoralogixSnapshotSpanProcessor = (function () {
4378
4378
  if (spanType === CoralogixEventType.USER_INTERACTION) {
4379
4379
  updateSnapshot({ actionCount: actionCount + 1 });
4380
4380
  }
4381
+ if (getSnapshotManager().shouldTriggerSnapshotContext) {
4382
+ shouldCreateSnapshot = true;
4383
+ getSnapshotManager().shouldTriggerSnapshotContext = false;
4384
+ }
4381
4385
  return shouldCreateSnapshot;
4382
4386
  };
4383
4387
  return CoralogixSnapshotSpanProcessor;
@@ -4386,6 +4390,7 @@ var CoralogixSnapshotSpanProcessor = (function () {
4386
4390
  var SnapshotManager = (function () {
4387
4391
  function SnapshotManager() {
4388
4392
  var _this = this;
4393
+ this._shouldTriggerSnapshotContext = false;
4389
4394
  this.updateSnapshot = function (overrides) {
4390
4395
  _this._currentSnapshot = __assign(__assign({}, _this._currentSnapshot), overrides);
4391
4396
  };
@@ -4421,6 +4426,16 @@ var SnapshotManager = (function () {
4421
4426
  enumerable: false,
4422
4427
  configurable: true
4423
4428
  });
4429
+ Object.defineProperty(SnapshotManager.prototype, "shouldTriggerSnapshotContext", {
4430
+ get: function () {
4431
+ return this._shouldTriggerSnapshotContext;
4432
+ },
4433
+ set: function (value) {
4434
+ this._shouldTriggerSnapshotContext = value;
4435
+ },
4436
+ enumerable: false,
4437
+ configurable: true
4438
+ });
4424
4439
  return SnapshotManager;
4425
4440
  }());
4426
4441
 
@@ -4793,6 +4808,7 @@ var CoralogixRum = {
4793
4808
  console.debug('CoralogixRum must be initiated before setting user context');
4794
4809
  return;
4795
4810
  }
4811
+ getSnapshotManager().shouldTriggerSnapshotContext = true;
4796
4812
  attributesProcessor === null || attributesProcessor === void 0 ? void 0 : attributesProcessor.setInternalLabels(__assign(__assign({}, attributesProcessor.getInternalLabels()), (_a = {}, _a[CoralogixAttributes.USER_CONTEXT] = userContext, _a)));
4797
4813
  },
4798
4814
  getUserContext: function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralogix/browser",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "Official Coralogix SDK for browsers",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Coralogix",
@@ -3,11 +3,14 @@ export declare class SnapshotManager {
3
3
  private _currentSnapshot;
4
4
  private _fragmentsState;
5
5
  private _isSnapshotSentDueToRecording;
6
+ private _shouldTriggerSnapshotContext;
6
7
  constructor();
7
8
  get fragmentsState(): Set<string>;
8
9
  get currentSnapshot(): SnapshotContext;
9
10
  get isSnapshotSentDueToRecording(): boolean;
11
+ get shouldTriggerSnapshotContext(): boolean;
10
12
  set isSnapshotSentDueToRecording(value: boolean);
13
+ set shouldTriggerSnapshotContext(value: boolean);
11
14
  updateSnapshot: (overrides: Partial<SnapshotContext>) => void;
12
15
  resetSnapshot: () => void;
13
16
  }
package/src/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.11.0";
1
+ export declare const SDK_VERSION = "2.11.1";