mixpanel-react-native 2.2.3 → 2.2.4
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 +10 -0
- package/__tests__/index.test.js +2 -2
- package/ios/AutomaticProperties.swift +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
#
|
|
2
2
|
|
|
3
|
+
## [v2.2.4](https://github.com/mixpanel/mixpanel-react-native/tree/v2.2.4) (2023-04-25)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- use semaphore to prevent concurrent access to properties object [\#188](https://github.com/mixpanel/mixpanel-react-native/pull/188)
|
|
8
|
+
|
|
9
|
+
#
|
|
10
|
+
|
|
3
11
|
## [v2.2.3](https://github.com/mixpanel/mixpanel-react-native/tree/v2.2.3) (2023-04-17)
|
|
4
12
|
|
|
5
13
|
### Fixes
|
|
@@ -280,6 +288,8 @@ Report issues or give us any feedback is appreciated!
|
|
|
280
288
|
|
|
281
289
|
|
|
282
290
|
|
|
291
|
+
|
|
292
|
+
|
|
283
293
|
|
|
284
294
|
|
|
285
295
|
|
package/__tests__/index.test.js
CHANGED
|
@@ -9,13 +9,13 @@ import { NativeModules } from 'react-native';
|
|
|
9
9
|
|
|
10
10
|
test(`it calls MixpanelReactNative initialize`, async () => {
|
|
11
11
|
const mixpanel = await Mixpanel.init("token", true);
|
|
12
|
-
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.2.
|
|
12
|
+
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, false, {"$lib_version": "2.2.4", "mp_lib": "react-native"});
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
test(`it calls MixpanelReactNative initialize with optOut and superProperties`, async () => {
|
|
16
16
|
const mixpanel = new Mixpanel("token", true);
|
|
17
17
|
mixpanel.init(true, {"super": "property"})
|
|
18
|
-
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.2.
|
|
18
|
+
expect(NativeModules.MixpanelReactNative.initialize).toBeCalledWith("token", true, true, {"$lib_version": "2.2.4", "mp_lib": "react-native", "super": "property"}, "https://api.mixpanel.com");
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
test(`it calls MixpanelReactNative setServerURL`, async () => {
|
|
@@ -3,10 +3,14 @@ import Mixpanel
|
|
|
3
3
|
|
|
4
4
|
class AutomaticProperties {
|
|
5
5
|
static var peopleProperties: Dictionary<String, MixpanelType> = [:];
|
|
6
|
+
private static let semaphore = DispatchSemaphore(value: 0)
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
static func setAutomaticProperties(_ properties: [String: Any]) {
|
|
8
|
-
|
|
10
|
+
semaphore.wait()
|
|
11
|
+
for (key,value) in properties {
|
|
9
12
|
peopleProperties[key] = MixpanelTypeHandler.mixpanelTypeValue(value)
|
|
10
13
|
}
|
|
14
|
+
semaphore.signal()
|
|
11
15
|
}
|
|
12
16
|
}
|