@miso.ai/client-sdk-core 1.10.2-beta.8 → 1.10.2-beta.9
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/plugin/user.js +5 -12
- package/dist/cjs/version.js +1 -1
- package/package.json +2 -2
- package/src/plugin/user.js +5 -12
- package/src/version.js +1 -1
package/dist/cjs/plugin/user.js
CHANGED
|
@@ -96,24 +96,17 @@ class UserPlugin extends _commons.Component {
|
|
|
96
96
|
exports.default = UserPlugin;
|
|
97
97
|
let _pageBasedAutoAnonymousId;
|
|
98
98
|
function getAutoAnonymousId() {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// in this case, abort getting the auto anonymous id
|
|
104
|
-
if (e.name !== 'SecurityError') {
|
|
105
|
-
throw e;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// fallback to page-based auto anonymous id
|
|
109
|
-
return _pageBasedAutoAnonymousId || (_pageBasedAutoAnonymousId = (0, _commons.uuidv4)());
|
|
99
|
+
// 1. Cache the value for the page
|
|
100
|
+
// 2. Get and set the value from cookies/localStorage is possible
|
|
101
|
+
// 3. In case cookies/localStorage are disabled, generate a new value for each page
|
|
102
|
+
return _pageBasedAutoAnonymousId || (_pageBasedAutoAnonymousId = (0, _commons.getOrComputeFromStorage)('miso_anonymous_id', _commons.uuidv4));
|
|
110
103
|
}
|
|
111
104
|
class UserContext {
|
|
112
105
|
constructor(plugin) {
|
|
113
106
|
this._plugin = plugin;
|
|
114
107
|
}
|
|
115
108
|
get anonymous_id() {
|
|
116
|
-
return this._anonymousId ||
|
|
109
|
+
return this._anonymousId || getAutoAnonymousId();
|
|
117
110
|
}
|
|
118
111
|
set anonymous_id(value) {
|
|
119
112
|
value = (0, _commons.asString)(value);
|
package/dist/cjs/version.js
CHANGED
package/package.json
CHANGED
package/src/plugin/user.js
CHANGED
|
@@ -64,17 +64,10 @@ export default class UserPlugin extends Component {
|
|
|
64
64
|
let _pageBasedAutoAnonymousId;
|
|
65
65
|
|
|
66
66
|
function getAutoAnonymousId() {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// in this case, abort getting the auto anonymous id
|
|
72
|
-
if (e.name !== 'SecurityError') {
|
|
73
|
-
throw e;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// fallback to page-based auto anonymous id
|
|
77
|
-
return _pageBasedAutoAnonymousId || (_pageBasedAutoAnonymousId = uuidv4());
|
|
67
|
+
// 1. Cache the value for the page
|
|
68
|
+
// 2. Get and set the value from cookies/localStorage is possible
|
|
69
|
+
// 3. In case cookies/localStorage are disabled, generate a new value for each page
|
|
70
|
+
return _pageBasedAutoAnonymousId || (_pageBasedAutoAnonymousId = getOrComputeFromStorage('miso_anonymous_id', uuidv4));
|
|
78
71
|
}
|
|
79
72
|
|
|
80
73
|
class UserContext {
|
|
@@ -84,7 +77,7 @@ class UserContext {
|
|
|
84
77
|
}
|
|
85
78
|
|
|
86
79
|
get anonymous_id() {
|
|
87
|
-
return this._anonymousId ||
|
|
80
|
+
return this._anonymousId || getAutoAnonymousId();
|
|
88
81
|
}
|
|
89
82
|
|
|
90
83
|
set anonymous_id(value) {
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.10.2-beta.
|
|
1
|
+
export default '1.10.2-beta.9';
|