@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/lib/index.js CHANGED
@@ -3822,7 +3822,7 @@ class App {
3822
3822
  this.stopCallbacks = [];
3823
3823
  this.commitCallbacks = [];
3824
3824
  this.activityState = ActivityState.NotActive;
3825
- this.version = '17.2.1'; // TODO: version compatability check inside each plugin.
3825
+ this.version = '17.2.2'; // TODO: version compatability check inside each plugin.
3826
3826
  this.socketMode = false;
3827
3827
  this.compressionThreshold = 24 * 1000;
3828
3828
  this.bc = null;
@@ -8615,7 +8615,7 @@ class ConstantProperties {
8615
8615
  user_id: this.user_id,
8616
8616
  distinct_id: this.deviceId,
8617
8617
  sdk_edition: 'web',
8618
- sdk_version: '17.2.1',
8618
+ sdk_version: '17.2.2',
8619
8619
  timezone: getUTCOffsetString(),
8620
8620
  search_engine: this.searchEngine,
8621
8621
  };
@@ -9058,9 +9058,12 @@ class Batcher {
9058
9058
  })
9059
9059
  .then((response) => {
9060
9060
  if ([403, 401].includes(response.status)) {
9061
- this.init().then(() => {
9062
- send();
9063
- });
9061
+ if (attempts < this.retryLimit) {
9062
+ return this.init().then(() => {
9063
+ send();
9064
+ });
9065
+ }
9066
+ return;
9064
9067
  }
9065
9068
  if (!response.ok) {
9066
9069
  throw new Error(`HTTP error! status: ${response.status}`);
@@ -9075,6 +9078,9 @@ class Batcher {
9075
9078
  void send();
9076
9079
  }
9077
9080
  startAutosend() {
9081
+ if (this.intervalId) {
9082
+ clearInterval(this.intervalId);
9083
+ }
9078
9084
  this.intervalId = setInterval(() => {
9079
9085
  this.flush();
9080
9086
  }, this.autosendInterval);
@@ -9123,7 +9129,9 @@ class Analytics {
9123
9129
  if (this.standalone) {
9124
9130
  return this.token;
9125
9131
  }
9126
- return this.getToken();
9132
+ else {
9133
+ return this.getToken();
9134
+ }
9127
9135
  };
9128
9136
  this._getTimestamp = () => {
9129
9137
  if (this.standalone) {
@@ -9259,7 +9267,7 @@ class API {
9259
9267
  this.signalStartIssue = (reason, missingApi) => {
9260
9268
  const doNotTrack = this.checkDoNotTrack();
9261
9269
  console.log("Tracker couldn't start due to:", JSON.stringify({
9262
- trackerVersion: '17.2.1',
9270
+ trackerVersion: '17.2.2',
9263
9271
  projectKey: this.options.projectKey,
9264
9272
  doNotTrack,
9265
9273
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,