You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebSocket client doesn't currently contain any handling for binary messages and just passes the message directly to bridge. This crashes the application.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (_NSInlineData)'
Pass error describing the issue instead of crashing
Convert NSData to string
Base64 encode NSData and convert to arraybuffer & blob in JS
Personally I'd prefer 4. as it brings the polyfill api more closer to actual WebSocket behaviour. I can take a stab at the problem once we've settled with the correct approach.
Thanks!
The text was updated successfully, but these errors were encountered:
It seems that FileReader and atob (and probably Blob) are not implemented in JSCore by default. One option could be to decode base64 in pure JS directly into a TypedArray and then only support binaryType="text" and binaryType="arraybuffer".
WebSocket client doesn't currently contain any handling for binary messages and just passes the message directly to bridge. This crashes the application.
Problematic code:
react-native/Libraries/WebSocket/RCTWebSocketManager.m
Lines 83 to 89 in 0c9c6e8
Few ways to fix this.
Personally I'd prefer 4. as it brings the polyfill api more closer to actual WebSocket behaviour. I can take a stab at the problem once we've settled with the correct approach.
Thanks!
The text was updated successfully, but these errors were encountered: