Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 9f144be

Browse files
Merge pull request #333 from heap/develop
Dev -> Master
2 parents b8d49f4 + f345df5 commit 9f144be

7 files changed

Lines changed: 45 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ __BEGIN_UNRELEASED__
1515
### Security
1616
__END_UNRELEASED__
1717

18+
## [0.22.0] - 2022-09-23
19+
### Added
20+
- Added tests for sending bad data to the native bridge
21+
### Changed
22+
- Changed track bridge to warn instead of throw an exception when bad data is sent.
23+
- Upgraded iOS sdk from 8.2 to 9.0
24+
1825
## [0.21.0] - 2022-06-29
1926

2027
### Added

android/src/main/java/com/heapanalytics/reactnative/RNHeapLibraryModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import java.util.HashMap;
1313
import java.util.Map;
1414

15+
import android.util.Log;
16+
1517
public class RNHeapLibraryModule extends ReactContextBaseJavaModule {
1618

1719
private final ReactApplicationContext reactContext;
@@ -81,7 +83,7 @@ private static Map<String, String> convertToStringMap(ReadableMap readableMap) {
8183
// The JS bridge will flatten maps and arrays in a uniform manner across both
8284
// platforms.
8385
// If we get them at this point, we shouldn't continue.
84-
throw new RNHeapException("Property objects must be flattened before being sent across the JS bridge.");
86+
Log.w("Property objects must be flattened before being sent across the JS bridge. If you get this warning please inspect for non-flattenable objects being sent to Heap");
8587
}
8688
}
8789
return stringMap;

integration-tests/src/screens/PropertiesScreen.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export const PropertiesScreen = ({navigation}) => {
4040
Heap.track('getSessionId', {value: await Heap.getSessionId()})
4141
}
4242
/>
43+
<Button
44+
title="Send Custom Event"
45+
onPress={async () =>
46+
Heap.track('custom-event', { a: {b: null, c: [1,2,3], d: new (class Test {}) } })
47+
}
48+
/>
4349
<Button title="Back" onPress={() => navigation.goBack()} />
4450
</ScrollView>
4551
);

integration-tests/tests/heap_properties.e2e.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,17 @@ describe('Heap Static Properties', () => {
6363
);
6464
});
6565
});
66+
67+
describe('track', () => {
68+
it('Should serialize properties without crashing', async () => {
69+
await tapButton('Send Custom Event');
70+
71+
const message = await tools.server.expectSourceCustomEventWithProperties(
72+
'custom-event',{
73+
'a.c.0': '1',
74+
'a.c.1': '2',
75+
'a.c.1': '3'}
76+
)
77+
})
78+
})
6679
});

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@heap/react-native-heap",
3-
"version": "0.21.0",
3+
"version": "0.22.0",
44
"description": "React Native event tracking with Heap.",
55
"license": "MIT",
66
"author": "Heap <http://www.heapanalytics.com>",

react-native-heap.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
1515
s.platform = :ios, "10.0"
1616

1717
s.dependency "React"
18-
s.dependency "Heap", "~> 8.2"
18+
s.dependency "Heap", "~> 9.0"
1919

2020
s.frameworks = "SystemConfiguration"
2121

0 commit comments

Comments
 (0)