@openreplay/tracker 16.4.7-beta.1 → 16.4.8

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
@@ -5051,6 +5051,23 @@ class Session {
5051
5051
  this.app.sessionStorage.setItem(this.options.session_pageno_key, pageNo.toString());
5052
5052
  return pageNo;
5053
5053
  };
5054
+ this.getSessionToken = (projectKey) => {
5055
+ const tokenWithProject = this.token || this.app.sessionStorage.getItem(this.options.session_token_key);
5056
+ if (projectKey && tokenWithProject) {
5057
+ const savedProject = tokenWithProject.split('_&_')[1];
5058
+ if (!savedProject || savedProject !== projectKey) {
5059
+ this.app.sessionStorage.removeItem(this.options.session_token_key);
5060
+ this.token = undefined;
5061
+ return undefined;
5062
+ }
5063
+ }
5064
+ const token = tokenWithProject ? tokenWithProject.split('_&_')[0] : null;
5065
+ return token || undefined;
5066
+ };
5067
+ this.setSessionToken = (token, projectKey) => {
5068
+ this.token = `${token}_&_${projectKey}`;
5069
+ this.app.sessionStorage.setItem(this.options.session_token_key, `${token}_&_${projectKey}`);
5070
+ };
5054
5071
  this.app = params.app;
5055
5072
  this.options = params.options;
5056
5073
  this.createTabId();
@@ -5097,23 +5114,6 @@ class Session {
5097
5114
  setUserInfo(userInfo) {
5098
5115
  this.userInfo = userInfo;
5099
5116
  }
5100
- getSessionToken(projectKey) {
5101
- const tokenWithProject = this.token || this.app.sessionStorage.getItem(this.options.session_token_key);
5102
- if (projectKey && tokenWithProject) {
5103
- const savedProject = tokenWithProject.split('_&_')[1];
5104
- if (!savedProject || savedProject !== projectKey) {
5105
- this.app.sessionStorage.removeItem(this.options.session_token_key);
5106
- this.token = undefined;
5107
- return undefined;
5108
- }
5109
- }
5110
- const token = tokenWithProject ? tokenWithProject.split('_&_')[0] : null;
5111
- return token || undefined;
5112
- }
5113
- setSessionToken(token, projectKey) {
5114
- this.token = token;
5115
- this.app.sessionStorage.setItem(this.options.session_token_key, `${token}_&_${projectKey}`);
5116
- }
5117
5117
  applySessionHash(hash) {
5118
5118
  const hashParts = decodeURI(hash).split('&');
5119
5119
  let token = hash;
@@ -5276,7 +5276,7 @@ class App {
5276
5276
  this.stopCallbacks = [];
5277
5277
  this.commitCallbacks = [];
5278
5278
  this.activityState = ActivityState.NotActive;
5279
- this.version = '16.4.7-beta.1'; // TODO: version compatability check inside each plugin.
5279
+ this.version = '16.4.8'; // TODO: version compatability check inside each plugin.
5280
5280
  this.socketMode = false;
5281
5281
  this.compressionThreshold = 24 * 1000;
5282
5282
  this.bc = null;
@@ -5886,6 +5886,7 @@ class App {
5886
5886
  }, 250);
5887
5887
  this.bc.onmessage = (ev) => {
5888
5888
  if (ev.data.context === this.contextId || this.projectKey !== ev.data.projectKey) {
5889
+ this.debug.log('same ctx event', ev);
5889
5890
  return;
5890
5891
  }
5891
5892
  this.debug.log(ev);
@@ -9669,7 +9670,7 @@ class API {
9669
9670
  this.signalStartIssue = (reason, missingApi) => {
9670
9671
  const doNotTrack = this.checkDoNotTrack();
9671
9672
  console.log("Tracker couldn't start due to:", JSON.stringify({
9672
- trackerVersion: '16.4.7-beta.1',
9673
+ trackerVersion: '16.4.8',
9673
9674
  projectKey: this.options.projectKey,
9674
9675
  doNotTrack,
9675
9676
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,