react-native/Libraries/WebSocket
Dmitry Petukhov 6b42d5c952 Updating Websocket readyState in case of websocketFailed event
Summary:
Fix for https://github.com/facebook/react-native/issues/9465

We are building a react-native based application which extensively uses WebSockets. The Android app crashes right after waking up being in suspended mode for a coupe of days and throws an exception:

"Cannot send a message. Unknown WebSocket id 1"

Before calling WebSocket.send(...) method from WebSocket.js we always check its readyState. I believe the problem is caused by not updating readyState if case of 'websocketFailed' event. this.close() cause the current used websocket ID to be removed from mWebSocketConnections HashMap (WebSocketModule.java), but readyState stays the same.
Closes https://github.com/facebook/react-native/pull/9487

Differential Revision: D3838675

Pulled By: mkonicek

fbshipit-source-id: e833cef9f1b94c6f7236077241cacf5a56f5824b
2016-09-08 17:13:45 -07:00
..
RCTWebSocket.xcodeproj Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
__mocks__ Fix WebSocket compatibility with event-target-shim ^1.0.5 2016-04-27 12:26:23 -07:00
__tests__ Update Jest APIs on fbsource 2016-04-27 19:16:32 -07:00
RCTSRWebSocket.h Backed out changeset 183744d2415b 2016-03-15 11:49:28 -07:00
RCTSRWebSocket.m Fix warning on unused return values in RCTSRWebSocket 2016-08-16 07:28:28 -07:00
RCTWebSocketExecutor.h Refactored module access to allow for lazy loading 2015-11-25 04:49:45 -08:00
RCTWebSocketExecutor.m Automated changes to remove implicit capture of self in blocks: Libraries/FBReactKit/BUCK 2016-07-07 12:44:14 -07:00
RCTWebSocketManager.h Enable persistent socket between packager and bridge (1/N). 2016-02-16 23:05:36 -08:00
RCTWebSocketManager.m Reconnect RCTWebSocketManager when packager restarts 2016-06-20 10:58:32 -07:00
RCTWebSocketModule.h Updated Websocket to use new event system 2016-05-12 08:30:24 -07:00
RCTWebSocketModule.m Add MessageQueue method for executing function and returning its result 2016-07-18 07:13:32 -07:00
WebSocket.js Updating Websocket readyState in case of websocketFailed event 2016-09-08 17:13:45 -07:00
WebSocketEvent.js Implement WebSocket module for Android. Fixes #2837 2015-10-07 08:36:22 -07:00