{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/1226","labels_url":"https://api.github.com/repos/facebook/react-native/issues/1226/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/1226/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/1226/events","html_url":"https://github.com/facebook/react-native/pull/1226","id":74883714,"number":1226,"title":"[GeoLocation] invalidate timer after success or error callback","user":{"login":"henter","id":239970,"avatar_url":"https://avatars.githubusercontent.com/u/239970?v=3","gravatar_id":"","url":"https://api.github.com/users/henter","html_url":"https://github.com/henter","followers_url":"https://api.github.com/users/henter/followers","following_url":"https://api.github.com/users/henter/following{/other_user}","gists_url":"https://api.github.com/users/henter/gists{/gist_id}","starred_url":"https://api.github.com/users/henter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henter/subscriptions","organizations_url":"https://api.github.com/users/henter/orgs","repos_url":"https://api.github.com/users/henter/repos","events_url":"https://api.github.com/users/henter/events{/privacy}","received_events_url":"https://api.github.com/users/henter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/react-native/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7"},{"url":"https://api.github.com/repos/facebook/react-native/labels/GH%20Review:%20accepted","name":"GH Review: accepted","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"sahrens","id":1509831,"avatar_url":"https://avatars.githubusercontent.com/u/1509831?v=3","gravatar_id":"","url":"https://api.github.com/users/sahrens","html_url":"https://github.com/sahrens","followers_url":"https://api.github.com/users/sahrens/followers","following_url":"https://api.github.com/users/sahrens/following{/other_user}","gists_url":"https://api.github.com/users/sahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/sahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sahrens/subscriptions","organizations_url":"https://api.github.com/users/sahrens/orgs","repos_url":"https://api.github.com/users/sahrens/repos","events_url":"https://api.github.com/users/sahrens/events{/privacy}","received_events_url":"https://api.github.com/users/sahrens/received_events","type":"User","site_admin":false},"milestone":null,"comments":19,"created_at":"2015-05-10T10:02:10Z","updated_at":"2015-07-07T04:19:58Z","closed_at":"2015-05-28T15:53:01Z","pull_request":{"url":"https://api.github.com/repos/facebook/react-native/pulls/1226","html_url":"https://github.com/facebook/react-native/pull/1226","diff_url":"https://github.com/facebook/react-native/pull/1226.diff","patch_url":"https://github.com/facebook/react-native/pull/1226.patch"},"body":"Just trying to [getCurrentPosition](https://github.com/facebook/react-native/blob/master/Libraries/Geolocation/Geolocation.js#L45) , and found the `errorBlock` of location request in timeout handler would cause red error like this:\r\n\r\n```\r\n2015-05-10 17:50:39.607 [warn][tid:com.facebook.React.JavaScript] \"Warning: Cannot find callback with CBID 5. Native module may have invoked both the success callback and the error callback.\"\r\n2015-05-10 17:50:39.610 [error][tid:com.facebook.React.JavaScript] \"Error: null is not an object (evaluating 'cb.apply')\r\n stack: \r\n  _invokeCallback  index.ios.bundle:7593\r\n  <unknown>        index.ios.bundle:7656\r\n  <unknown>        index.ios.bundle:7648\r\n  perform          index.ios.bundle:6157\r\n  batchedUpdates   index.ios.bundle:13786\r\n  batchedUpdates   index.ios.bundle:4689\r\n  <unknown>        index.ios.bundle:7647\r\n  applyWithGuard   index.ios.bundle:882\r\n  guardReturn      index.ios.bundle:7421\r\n  processBatch     index.ios.bundle:7646\r\n URL: http://192.168.100.182:8081/index.ios.bundle\r\n line: 7593\r\n message: null is not an object (evaluating 'cb.apply')\"\r\n```\r\n\r\n![img_0837](https://cloud.githubusercontent.com/assets/239970/7553804/3879b99c-f73d-11e4-9c17-55f6ce419651.PNG)\r\n\r\n~~I'm not sure if there is a better way to avoid multiple callback which caused the error, \r\nbut I don't think that the `errorBlock` should be called in timeout handler.\r\nSo, just remove it.~~\r\n\r\nupdate: to invalidate the timer after success or error callback.\r\n\r\n\r\nI just use the [demo code of Geolocation](http://facebook.github.io/react-native/docs/geolocation.html#examples)"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/119068824","html_url":"https://github.com/facebook/react-native/pull/1226#issuecomment-119068824","issue_url":"https://api.github.com/repos/facebook/react-native/issues/1226","id":119068824,"user":{"login":"justinhj","id":753059,"avatar_url":"https://avatars.githubusercontent.com/u/753059?v=3","gravatar_id":"","url":"https://api.github.com/users/justinhj","html_url":"https://github.com/justinhj","followers_url":"https://api.github.com/users/justinhj/followers","following_url":"https://api.github.com/users/justinhj/following{/other_user}","gists_url":"https://api.github.com/users/justinhj/gists{/gist_id}","starred_url":"https://api.github.com/users/justinhj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinhj/subscriptions","organizations_url":"https://api.github.com/users/justinhj/orgs","repos_url":"https://api.github.com/users/justinhj/repos","events_url":"https://api.github.com/users/justinhj/events{/privacy}","received_events_url":"https://api.github.com/users/justinhj/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T04:19:58Z","updated_at":"2015-07-07T04:19:58Z","body":"I've updated to the latest publicly available React native, but this crash still happens using the demo code provided."}}