@openreplay/tracker 17.0.0 → 17.0.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/dist/cjs/entry.js CHANGED
@@ -3519,8 +3519,7 @@ class Observer {
3519
3519
  sl.assignedNodes({ flatten: true }).forEach((n) => {
3520
3520
  const nid = this.app.nodes.getID(n);
3521
3521
  if (nid !== undefined) {
3522
- this.recents.set(nid, RecentsType.Removed);
3523
- this.commitNode(nid);
3522
+ this.recents.set(nid, RecentsType.Changed);
3524
3523
  }
3525
3524
  });
3526
3525
  });
@@ -3587,13 +3586,6 @@ class Observer {
3587
3586
  return true;
3588
3587
  }
3589
3588
  let slot = node.assignedSlot;
3590
- let isLightDom = false;
3591
- if (slot) {
3592
- // Check if the node is in light DOM (not in shadow DOM)
3593
- // This is a workaround for the issue with shadow DOM and slots
3594
- // where the slot is not assigned to the node in shadow DOM.
3595
- isLightDom = node.getRootNode() instanceof ShadowRoot;
3596
- }
3597
3589
  const parent = node.parentNode;
3598
3590
  let parentID;
3599
3591
  // Disable parent check for the upper context HTMLHtmlElement, because it is root there... (before)
@@ -3606,15 +3598,7 @@ class Observer {
3606
3598
  this.unbindTree(node);
3607
3599
  return false;
3608
3600
  }
3609
- if (isLightDom && slot) {
3610
- parentID = this.app.nodes.getID(slot);
3611
- // in light dom, we don't "slot" the node,
3612
- // but rather use the slot as a parent
3613
- slot = null;
3614
- }
3615
- else {
3616
- parentID = this.app.nodes.getID(parent);
3617
- }
3601
+ parentID = this.app.nodes.getID(parent);
3618
3602
  if (parentID === undefined) {
3619
3603
  this.unbindTree(node);
3620
3604
  return false;
@@ -4163,6 +4147,7 @@ class Sanitizer {
4163
4147
  }
4164
4148
  }
4165
4149
 
4150
+ const tokenSeparator = '_$_';
4166
4151
  class Session {
4167
4152
  constructor(params) {
4168
4153
  this.metadata = {};
@@ -4190,19 +4175,22 @@ class Session {
4190
4175
  this.getSessionToken = (projectKey) => {
4191
4176
  const tokenWithProject = this.token || this.app.sessionStorage.getItem(this.options.session_token_key);
4192
4177
  if (projectKey && tokenWithProject) {
4193
- const savedProject = tokenWithProject.split('_&_')[1];
4178
+ const savedProject = tokenWithProject.split(tokenSeparator)[1];
4194
4179
  if (!savedProject || savedProject !== projectKey) {
4195
4180
  this.app.sessionStorage.removeItem(this.options.session_token_key);
4196
4181
  this.token = undefined;
4197
4182
  return undefined;
4198
4183
  }
4199
4184
  }
4200
- const token = tokenWithProject ? tokenWithProject.split('_&_')[0] : null;
4185
+ const token = tokenWithProject ? tokenWithProject.split(tokenSeparator)[0] : null;
4201
4186
  return token || undefined;
4202
4187
  };
4188
+ this.getRawTokenWithProject = () => {
4189
+ return this.token || this.app.sessionStorage.getItem(this.options.session_token_key);
4190
+ };
4203
4191
  this.setSessionToken = (token, projectKey) => {
4204
- this.token = `${token}_&_${projectKey}`;
4205
- this.app.sessionStorage.setItem(this.options.session_token_key, `${token}_&_${projectKey}`);
4192
+ this.token = `${token}${tokenSeparator}${projectKey}`;
4193
+ this.app.sessionStorage.setItem(this.options.session_token_key, `${token}${tokenSeparator}${projectKey}`);
4206
4194
  };
4207
4195
  this.app = params.app;
4208
4196
  this.options = params.options;
@@ -4265,7 +4253,7 @@ class Session {
4265
4253
  }
4266
4254
  getSessionHash() {
4267
4255
  const pageNo = this.getPageNumber();
4268
- const token = this.getSessionToken();
4256
+ const token = this.getRawTokenWithProject();
4269
4257
  if (pageNo === undefined || token === undefined) {
4270
4258
  return;
4271
4259
  }
@@ -4411,7 +4399,7 @@ class App {
4411
4399
  this.stopCallbacks = [];
4412
4400
  this.commitCallbacks = [];
4413
4401
  this.activityState = ActivityState.NotActive;
4414
- this.version = '17.0.0'; // TODO: version compatability check inside each plugin.
4402
+ this.version = '17.0.1'; // TODO: version compatability check inside each plugin.
4415
4403
  this.socketMode = false;
4416
4404
  this.compressionThreshold = 24 * 1000;
4417
4405
  this.bc = null;
@@ -8879,7 +8867,7 @@ class API {
8879
8867
  this.signalStartIssue = (reason, missingApi) => {
8880
8868
  const doNotTrack = this.checkDoNotTrack();
8881
8869
  console.log("Tracker couldn't start due to:", JSON.stringify({
8882
- trackerVersion: '17.0.0',
8870
+ trackerVersion: '17.0.1',
8883
8871
  projectKey: this.options.projectKey,
8884
8872
  doNotTrack,
8885
8873
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,