react-native: Regression on 0.55.0 crash: WebSocketModule.close got 1 arguments, expected 3
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
Closing a websocket crashes the app
Environment
$ react-native info
Scanning folders for symlinks in /media/dj/dev/scan-app/node_modules (9ms)
Environment:
OS: Linux 4.13
Node: 9.10.1
Yarn: Not Found
npm: 5.6.0
Watchman: 4.7.0
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.3.0-rc.0 => 16.3.0-rc.0
react-native: ^0.55.0 => 0.55.0
Steps to Reproduce
- open websocket connection. example:
const ws = new WebSocket(makeSocketURL())
- close websocket connection. example:
ws.close()
Expected Behavior
the websocket connection closes, no error
Actual Behavior
Logcat:
--------- beginning of crash
04-04 14:28:15.716 19745 19780 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
04-04 14:28:15.716 19745 19780 E AndroidRuntime: Process: com.chipta, PID: 19745
04-04 14:28:15.716 19745 19780 E AndroidRuntime: com.facebook.react.bridge.NativeArgumentsParseException: WebSocketModule.close got 1 arguments, expected 3
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:353)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:754)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at android.os.Looper.loop(Looper.java:163)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
04-04 14:28:15.716 19745 19780 E AndroidRuntime: at java.lang.Thread.run(Thread.java:760)
04-04 14:28:16.322 19745 19745 D ReactNative: ReactInstanceManager.detachViewFromInstance()
related: https://github.com/facebook/react-native/issues/18623
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 13
- Comments: 22 (1 by maintainers)
Commits related to this issue
- Revert "Remove Platform check from WebSocket module" Summary: This reverts commit b9be28915cf323eb36f1d7c77821cdf994954074. Thank you for sending the PR! We appreciate you spending the time to work ... — committed to exozet/react-native by rozele 6 years ago
- Revert "Remove Platform check from WebSocket module" Summary: This reverts commit b9be28915cf323eb36f1d7c77821cdf994954074. Thank you for sending the PR! We appreciate you spending the time to work ... — committed to LukeDurrant/react-native by rozele 6 years ago
- Revert "Remove Platform check from WebSocket module" Summary: This reverts commit b9be28915cf323eb36f1d7c77821cdf994954074. Thank you for sending the PR! We appreciate you spending the time to work ... — committed to LukeDurrant/react-native by rozele 6 years ago
- Revert "Remove Platform check from WebSocket module" Summary: This reverts commit b9be28915cf323eb36f1d7c77821cdf994954074. Thank you for sending the PR! We appreciate you spending the time to work ... — committed to facebook/react-native by rozele 6 years ago
- Revert "Remove Platform check from WebSocket module" Summary: This reverts commit b9be28915cf323eb36f1d7c77821cdf994954074. Thank you for sending the PR! We appreciate you spending the time to work ... — committed to expo/react-native by rozele 6 years ago
- Revert "Remove Platform check from WebSocket module" Summary: This reverts commit b9be28915cf323eb36f1d7c77821cdf994954074. Thank you for sending the PR! We appreciate you spending the time to work ... — committed to macdoum1/react-native by rozele 6 years ago
I just installed the current latest version
"react-native": "^0.55.3"
and (magically 😄 ) the problem disappeared.Please release v0.55.3 to fixed this
To discuss cherry-picks and critical things, there’s a dedicated repo with a dedicated issue (this).
We’ll keep you updated.
In the meantime I think pinging @rozele to know more about his commit is a good approach.
I’m still experiencing WebSocketModule.close got 1 arguments, expected 3 on React native version 0.55.4. Using expo sdk 28.0.1. Anyone else having this issue?
@vahanNasibyan, this is what I did:
In your package.json file, declare the postinstall script:
In a scripts folder in root directory, I have a script
third-party-boo-boos.sh
:Delete your node_modules and reinstall them with
npm install
oryarn
This is still an issue on RN-0.55.2. This is a very serious issue! Why was this closed?
https://github.com/facebook/react-native/commit/b9be289 is definitely causing this issue, since
WebSocketModule.close.length
is always returning0
, which results in passing always only 1 parameter toclose()
.Since this really is a severe bug, causing the entire app to crash and not to respond whenever one tries to close a websocket connection, I hope someone from the react-native team is going to revert the referenced commit and publish
0.55.1
version as soon as possible. Maybe @hramos?@ujwal-setlur The fix is merged to master and a request was put in to cherry-pick it for RN 0.55.3.
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.54?
Thank you for your contributions.