{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/3364","labels_url":"https://api.github.com/repos/facebook/react-native/issues/3364/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/3364/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/3364/events","html_url":"https://github.com/facebook/react-native/issues/3364","id":111027162,"number":3364,"title":"[WebSocket] Look into whether state == OPEN check should go into _closeWebSocket","user":{"login":"ide","id":379606,"avatar_url":"https://avatars.githubusercontent.com/u/379606?v=3","gravatar_id":"","url":"https://api.github.com/users/ide","html_url":"https://github.com/ide","followers_url":"https://api.github.com/users/ide/followers","following_url":"https://api.github.com/users/ide/following{/other_user}","gists_url":"https://api.github.com/users/ide/gists{/gist_id}","starred_url":"https://api.github.com/users/ide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ide/subscriptions","organizations_url":"https://api.github.com/users/ide/orgs","repos_url":"https://api.github.com/users/ide/repos","events_url":"https://api.github.com/users/ide/events{/privacy}","received_events_url":"https://api.github.com/users/ide/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-12T18:15:13Z","updated_at":"2015-11-13T01:44:49Z","closed_at":null,"body":"See https://github.com/facebook/react-native/pull/3347."},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/156291483","html_url":"https://github.com/facebook/react-native/issues/3364#issuecomment-156291483","issue_url":"https://api.github.com/repos/facebook/react-native/issues/3364","id":156291483,"user":{"login":"puf","id":913631,"avatar_url":"https://avatars.githubusercontent.com/u/913631?v=3","gravatar_id":"","url":"https://api.github.com/users/puf","html_url":"https://github.com/puf","followers_url":"https://api.github.com/users/puf/followers","following_url":"https://api.github.com/users/puf/following{/other_user}","gists_url":"https://api.github.com/users/puf/gists{/gist_id}","starred_url":"https://api.github.com/users/puf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puf/subscriptions","organizations_url":"https://api.github.com/users/puf/orgs","repos_url":"https://api.github.com/users/puf/repos","events_url":"https://api.github.com/users/puf/events{/privacy}","received_events_url":"https://api.github.com/users/puf/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T01:44:49Z","updated_at":"2015-11-13T01:44:49Z","body":"Using Firebase it is a simple to reproduce this bug:\r\n```\r\nvar Firebase = require('firebase');\r\nvar React = require('react-native');\r\nvar {\r\n  AppRegistry,\r\n  StyleSheet,\r\n  Text,\r\n  View,\r\n  TextInput,\r\n  TouchableHighlight,\r\n} = React;\r\n\r\nvar AwesomeProject = React.createClass({\r\n  getInitialState: function() {\r\n    return {\r\n      items: []\r\n    };\r\n  },\r\n  componentWillMount: function() {\r\n    this.ref = new Firebase('https://<yourapp>.firebaseio.com/');\r\n    this.ref.on('value', function(snapshot) {\r\n      var items = [];\r\n      snapshot.forEach(function(child) {\r\n        items.push(child.val());\r\n      });\r\n      this.setState({ 'items': items });\r\n    }.bind(this));\r\n  },\r\n```\r\nThe Firebase server performs a so-called reset when the client initially connects, redirecting it to the correct server. In this scenario the server closes the socket, after which the Firebase client also closes the socket and thus causes the RuntimeException. [The PR](https://github.com/facebook/react-native/pull/3347) perfectly fixes the problem."}}