@openreplay/tracker 17.2.1 → 17.2.2

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
@@ -3826,7 +3826,7 @@ class App {
3826
3826
  this.stopCallbacks = [];
3827
3827
  this.commitCallbacks = [];
3828
3828
  this.activityState = ActivityState.NotActive;
3829
- this.version = '17.2.1'; // TODO: version compatability check inside each plugin.
3829
+ this.version = '17.2.2'; // TODO: version compatability check inside each plugin.
3830
3830
  this.socketMode = false;
3831
3831
  this.compressionThreshold = 24 * 1000;
3832
3832
  this.bc = null;
@@ -8619,7 +8619,7 @@ class ConstantProperties {
8619
8619
  user_id: this.user_id,
8620
8620
  distinct_id: this.deviceId,
8621
8621
  sdk_edition: 'web',
8622
- sdk_version: '17.2.1',
8622
+ sdk_version: '17.2.2',
8623
8623
  timezone: getUTCOffsetString(),
8624
8624
  search_engine: this.searchEngine,
8625
8625
  };
@@ -9062,9 +9062,12 @@ class Batcher {
9062
9062
  })
9063
9063
  .then((response) => {
9064
9064
  if ([403, 401].includes(response.status)) {
9065
- this.init().then(() => {
9066
- send();
9067
- });
9065
+ if (attempts < this.retryLimit) {
9066
+ return this.init().then(() => {
9067
+ send();
9068
+ });
9069
+ }
9070
+ return;
9068
9071
  }
9069
9072
  if (!response.ok) {
9070
9073
  throw new Error(`HTTP error! status: ${response.status}`);
@@ -9079,6 +9082,9 @@ class Batcher {
9079
9082
  void send();
9080
9083
  }
9081
9084
  startAutosend() {
9085
+ if (this.intervalId) {
9086
+ clearInterval(this.intervalId);
9087
+ }
9082
9088
  this.intervalId = setInterval(() => {
9083
9089
  this.flush();
9084
9090
  }, this.autosendInterval);
@@ -9127,7 +9133,9 @@ class Analytics {
9127
9133
  if (this.standalone) {
9128
9134
  return this.token;
9129
9135
  }
9130
- return this.getToken();
9136
+ else {
9137
+ return this.getToken();
9138
+ }
9131
9139
  };
9132
9140
  this._getTimestamp = () => {
9133
9141
  if (this.standalone) {
@@ -9263,7 +9271,7 @@ class API {
9263
9271
  this.signalStartIssue = (reason, missingApi) => {
9264
9272
  const doNotTrack = this.checkDoNotTrack();
9265
9273
  console.log("Tracker couldn't start due to:", JSON.stringify({
9266
- trackerVersion: '17.2.1',
9274
+ trackerVersion: '17.2.2',
9267
9275
  projectKey: this.options.projectKey,
9268
9276
  doNotTrack,
9269
9277
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,