Open ddalp opened 4 years ago
Related int64 vs double issues #4181
This is happening even deeper in RN - numeric literals are coming into folly::dynamic objetcs as ints on Debug and doubles on Release. The JSValues are forwarding exactly what they received from folly
The JSValue APIs for native modules now include better functions for getting numerical values (doing the casting for you). As for why folly differs in the first place, that's still a lower level problem.
This is likely a JSI (in release_ vs non-JSI (Using WebSocketJSExecutor) thing. My understanding is that RN core has the same sort of behavior, where types have been different in legacy vs JSI.
Not sure there is much we can do though, and eventually everything will be on JSI.
This bug was found while writing the Camera Native Module. For example: Method TakePicture() below: REACT_METHOD(takePicture) void takePicture( std::map<std::wstring, winrt::Microsoft::ReactNative::JSValue>&& options, int viewTag, winrt::Microsoft::ReactNative::ReactPromise&& result) noexcept);
Options can contain a value pair such as {"target", 2}, when parsing the JSValue, 2 is Int64 in debug build but Double in Release build. I have to write a utility function to parse both types as a workaround.