@legalplace/wizardx-core 2.6.0 → 2.6.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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.6.2](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.6.1...@legalplace/wizardx-core@2.6.2) (2021-12-10)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * loading mixpanel before GTM, reducing queue timeout to fix tracking issues api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([bb13e5a](https://git.legalplace.eu/legalplace/monorepo/commits/bb13e5a959d18fe04c3cc10e1ee2f5bf66529abd))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.6.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.6.0...@legalplace/wizardx-core@2.6.1) (2021-12-09)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * fix Ab tests tracking api[#4480](https://git.legalplace.eu/legalplace/monorepo/issues/4480) ([9942e36](https://git.legalplace.eu/legalplace/monorepo/commits/9942e36e798195188a172384ce41bba7d967ac54))
23
+
24
+
25
+
26
+
27
+
6
28
  # [2.6.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.5.3...@legalplace/wizardx-core@2.6.0) (2021-12-08)
7
29
 
8
30
 
@@ -41,22 +41,18 @@ class _EventsTracking {
41
41
  }
42
42
  getXAbTests() {
43
43
  const xAbTests = cookie.get("X-AbTests");
44
- try {
45
- const xAbTestsObject = JSON.parse(xAbTests);
44
+ if (typeof xAbTests === "object") {
46
45
  const xAbTestsFlattened = {};
47
- Object.keys(xAbTestsObject).forEach((abTestName) => {
48
- xAbTestsFlattened[`X-AbTests[${abTestName}]`] =
49
- xAbTestsObject[abTestName];
46
+ Object.keys(xAbTests).forEach((abTestName) => {
47
+ xAbTestsFlattened[`X-AbTests[${abTestName}]`] = xAbTests[abTestName];
50
48
  });
51
- return xAbTestsObject;
52
- }
53
- catch (e) {
54
- return typeof xAbTests === "string" && xAbTests.trim().length > 0
55
- ? {
56
- "X-AbTests": xAbTests,
57
- }
58
- : {};
49
+ return xAbTestsFlattened;
59
50
  }
51
+ return typeof xAbTests === "string" && xAbTests.trim().length > 0
52
+ ? {
53
+ "X-AbTests": xAbTests,
54
+ }
55
+ : {};
60
56
  }
61
57
  executeQueue() {
62
58
  for (let i = 0; i < this.queue.length; i += 1) {
@@ -105,7 +101,7 @@ class _EventsTracking {
105
101
  clearTimeout(this.queueTimer);
106
102
  this.queueTimer = setTimeout(() => {
107
103
  this.executeQueue();
108
- }, 500);
104
+ }, 50);
109
105
  }
110
106
  trackMix(eventName, eventProps, doNotPushToQueue = false) {
111
107
  if (!this.initiated)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/wizardx-core",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "author": "Moncef Hammou (moncef@legalplace.fr)",
5
5
  "license": "MIT",
6
6
  "exports": {
@@ -92,5 +92,5 @@
92
92
  "*.test.ts",
93
93
  "*.test.tsx"
94
94
  ],
95
- "gitHead": "ed1fddfc65363d82140964988ced16a13ab0df00"
95
+ "gitHead": "5f5b32deb049cf3573955c176b7ac62e6fbd6f55"
96
96
  }
@@ -74,23 +74,21 @@ class _EventsTracking {
74
74
  private getXAbTests(): Record<string, string> {
75
75
  const xAbTests = cookie.get("X-AbTests");
76
76
 
77
- try {
78
- const xAbTestsObject = JSON.parse(xAbTests);
77
+ if (typeof xAbTests === "object") {
79
78
  const xAbTestsFlattened: Record<string, string> = {};
80
79
 
81
- Object.keys(xAbTestsObject).forEach((abTestName) => {
82
- xAbTestsFlattened[`X-AbTests[${abTestName}]`] =
83
- xAbTestsObject[abTestName];
80
+ Object.keys(xAbTests).forEach((abTestName) => {
81
+ xAbTestsFlattened[`X-AbTests[${abTestName}]`] = xAbTests[abTestName];
84
82
  });
85
83
 
86
- return xAbTestsObject;
87
- } catch (e) {
88
- return typeof xAbTests === "string" && xAbTests.trim().length > 0
89
- ? {
90
- "X-AbTests": xAbTests,
91
- }
92
- : {};
84
+ return xAbTestsFlattened;
93
85
  }
86
+
87
+ return typeof xAbTests === "string" && xAbTests.trim().length > 0
88
+ ? {
89
+ "X-AbTests": xAbTests,
90
+ }
91
+ : {};
94
92
  }
95
93
 
96
94
  /**
@@ -151,7 +149,7 @@ class _EventsTracking {
151
149
 
152
150
  this.queueTimer = setTimeout(() => {
153
151
  this.executeQueue();
154
- }, 500);
152
+ }, 50);
155
153
  }
156
154
 
157
155
  public trackMix(