@openreplay/tracker 16.1.0-beta.10 → 16.1.0-beta.3

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
@@ -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
  }
@@ -746,7 +744,8 @@ class AttributeSender {
746
744
  constructor(options) {
747
745
  this.sendSetAttribute = (id, name, value) => {
748
746
  if (this.isDictDisabled) {
749
- const msg = [12 /* Type.SetNodeAttribute */, id, name, value];
747
+ const attr = `${value}`;
748
+ const msg = [12 /* Type.SetNodeAttribute */, id, name, attr];
750
749
  return this.app.send(msg);
751
750
  }
752
751
  else {
@@ -4708,7 +4707,7 @@ class App {
4708
4707
  this.stopCallbacks = [];
4709
4708
  this.commitCallbacks = [];
4710
4709
  this.activityState = ActivityState.NotActive;
4711
- this.version = '16.1.0-beta.10'; // TODO: version compatability check inside each plugin.
4710
+ this.version = '16.1.0-beta.3'; // TODO: version compatability check inside each plugin.
4712
4711
  this.socketMode = false;
4713
4712
  this.compressionThreshold = 24 * 1000;
4714
4713
  this.bc = null;
@@ -5347,15 +5346,8 @@ class App {
5347
5346
  this.worker?.postMessage(this.messages);
5348
5347
  }
5349
5348
  catch (e) {
5349
+ console.log(this.messages.join('$___$'));
5350
5350
  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
5351
  }
5360
5352
  this.commitCallbacks.forEach((cb) => cb(this.messages));
5361
5353
  this.messages.length = 0;
@@ -9184,7 +9176,7 @@ class API {
9184
9176
  this.signalStartIssue = (reason, missingApi) => {
9185
9177
  const doNotTrack = this.checkDoNotTrack();
9186
9178
  console.log("Tracker couldn't start due to:", JSON.stringify({
9187
- trackerVersion: '16.1.0-beta.10',
9179
+ trackerVersion: '16.1.0-beta.3',
9188
9180
  projectKey: this.options.projectKey,
9189
9181
  doNotTrack,
9190
9182
  reason: missingApi.length ? `missing api: ${missingApi.join(',')}` : reason,