react-native-heap
react-native-heap copied to clipboard
Android crash tracking an object with an array.
When tracking an object that includes an array as property, on Android we are seeing a crash.
Error is:
Property objects must be flattened before being sent across the JS bridge.
convertToStringMap
RNHeapLibraryModule.java:81
manuallyTrackEvent
RNHeapLibraryModule.java:114
invoke
Method.java
invoke
JavaMethodWrapper.java:372
invoke
JavaModuleWrapper.java:158
run
NativeRunnable.java
handleCallback
Handler.java:789
dispatchMessage
Handler.java:98
dispatchMessage
MessageQueueThreadHandler.java:29
loop
Looper.java:164
run
MessageQueueThreadImpl.java:232
run
Thread.java:764
Removing the array property fixes the problem.
Version is 0.10.0. React Native version is 0.59.10.
Thanks for the report! Heap doesn't support non-scalar property values at present, so the likely fix here is going to be to throw an exception on the JS side with a more meaningful error message. My suggestion is to flatten the array, eg via array.join(',').
Maybe mention it in the docs somewhere? Or is it already there and I missed it?
Could the Heap library fail gracefully instead of crashing the app when this happens?