@openreplay/tracker 16.1.0-beta.10 → 16.1.0-beta.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.
@@ -5,11 +5,11 @@ export declare class StringDictionary {
5
5
  /** backwards dictionary of
6
6
  * [repeated str:key]
7
7
  * */
8
- backDict: Record<string, number>;
8
+ private backDict;
9
9
  getKey: (str: string) => [number, boolean];
10
10
  }
11
11
  export default class AttributeSender {
12
- dict: StringDictionary;
12
+ private dict;
13
13
  private readonly app;
14
14
  private readonly isDictDisabled;
15
15
  constructor(options: {
package/dist/lib/entry.js CHANGED
@@ -721,9 +721,7 @@ class StringDictionary {
721
721
  this.backDict = {};
722
722
  this.getKey = (str) => {
723
723
  let isNew = false;
724
- // avoiding potential native object properties
725
- const safeKey = `__${str}`;
726
- if (!this.backDict[safeKey]) {
724
+ if (!this.backDict[str]) {
727
725
  isNew = true;
728
726
  // shaving the first 2 digits of the timestamp (since they are irrelevant for next millennia)
729
727
  const shavedTs = Date.now() % 10 ** (13 - 2);
@@ -735,10 +733,10 @@ class StringDictionary {
735
733
  else {
736
734
  this.lastSuffix = 1;
737
735
  }
738
- this.backDict[safeKey] = id;
736
+ this.backDict[str] = id;
739
737
  this.lastTs = shavedTs;
740
738
  }
741
- return [this.backDict[safeKey], isNew];
739
+ return [this.backDict[str], isNew];
742
740
  };
743
741
  }
744
742
  }
@@ -4708,7 +4706,7 @@ class App {
4708
4706
  this.stopCallbacks = [];
4709
4707
  this.commitCallbacks = [];
4710
4708
  this.activityState = ActivityState.NotActive;
4711
- this.version = '16.1.0-beta.10'; // TODO: version compatability check inside each plugin.
4709
+ this.version = '16.1.0-beta.2'; // TODO: version compatability check inside each plugin.
4712
4710
  this.socketMode = false;
4713
4711
  this.compressionThreshold = 24 * 1000;
4714
4712
  this.bc = null;
@@ -5347,15 +5345,8 @@ class App {
5347
5345
  this.worker?.postMessage(this.messages);
5348
5346
  }
5349
5347
  catch (e) {
5348
+ console.log(this.messages.join('$___$'));
5350
5349
  console.error(e);
5351
- this.messages.forEach(m => {
5352
- try {
5353
- this.worker?.postMessage([m]);
5354
- }
5355
- catch (e) {
5356
- console.error(m, e);
5357
- }
5358
- });
5359
5350
  }
5360
5351
  this.commitCallbacks.forEach((cb) => cb(this.messages));
5361
5352
  this.messages.length = 0;
@@ -9184,7 +9175,7 @@ class API {
9184
9175
  this.signalStartIssue = (reason, missingApi) => {
9185
9176
  const doNotTrack = this.checkDoNotTrack();
9186
9177
  console.log("Tracker couldn't start due to:", JSON.stringify({
9187
- trackerVersion: '16.1.0-beta.10',
9178
+ trackerVersion: '16.1.0-beta.2',
9188
9179
  projectKey: this.options.projectKey,
9189
9180
  doNotTrack,
9190
9181
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,