{"action":"created","issue":{"url":"https://api.github.com/repos/js-platform/node-webrtc/issues/339","repository_url":"https://api.github.com/repos/js-platform/node-webrtc","labels_url":"https://api.github.com/repos/js-platform/node-webrtc/issues/339/labels{/name}","comments_url":"https://api.github.com/repos/js-platform/node-webrtc/issues/339/comments","events_url":"https://api.github.com/repos/js-platform/node-webrtc/issues/339/events","html_url":"https://github.com/js-platform/node-webrtc/issues/339","id":277046898,"number":339,"title":"0.0.63 partially breaks simple-peer","user":{"login":"nazar-pc","id":928965,"avatar_url":"https://avatars0.githubusercontent.com/u/928965?v=4","gravatar_id":"","url":"https://api.github.com/users/nazar-pc","html_url":"https://github.com/nazar-pc","followers_url":"https://api.github.com/users/nazar-pc/followers","following_url":"https://api.github.com/users/nazar-pc/following{/other_user}","gists_url":"https://api.github.com/users/nazar-pc/gists{/gist_id}","starred_url":"https://api.github.com/users/nazar-pc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nazar-pc/subscriptions","organizations_url":"https://api.github.com/users/nazar-pc/orgs","repos_url":"https://api.github.com/users/nazar-pc/repos","events_url":"https://api.github.com/users/nazar-pc/events{/privacy}","received_events_url":"https://api.github.com/users/nazar-pc/received_events","type":"User","site_admin":false},"labels":[{"id":83335517,"url":"https://api.github.com/repos/js-platform/node-webrtc/labels/needs-info","name":"needs-info","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":{"login":"markandrus","id":359154,"avatar_url":"https://avatars3.githubusercontent.com/u/359154?v=4","gravatar_id":"","url":"https://api.github.com/users/markandrus","html_url":"https://github.com/markandrus","followers_url":"https://api.github.com/users/markandrus/followers","following_url":"https://api.github.com/users/markandrus/following{/other_user}","gists_url":"https://api.github.com/users/markandrus/gists{/gist_id}","starred_url":"https://api.github.com/users/markandrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markandrus/subscriptions","organizations_url":"https://api.github.com/users/markandrus/orgs","repos_url":"https://api.github.com/users/markandrus/repos","events_url":"https://api.github.com/users/markandrus/events{/privacy}","received_events_url":"https://api.github.com/users/markandrus/received_events","type":"User","site_admin":false},"assignees":[{"login":"markandrus","id":359154,"avatar_url":"https://avatars3.githubusercontent.com/u/359154?v=4","gravatar_id":"","url":"https://api.github.com/users/markandrus","html_url":"https://github.com/markandrus","followers_url":"https://api.github.com/users/markandrus/followers","following_url":"https://api.github.com/users/markandrus/following{/other_user}","gists_url":"https://api.github.com/users/markandrus/gists{/gist_id}","starred_url":"https://api.github.com/users/markandrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markandrus/subscriptions","organizations_url":"https://api.github.com/users/markandrus/orgs","repos_url":"https://api.github.com/users/markandrus/repos","events_url":"https://api.github.com/users/markandrus/events{/privacy}","received_events_url":"https://api.github.com/users/markandrus/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-11-27T14:57:37Z","updated_at":"2017-11-27T19:10:30Z","closed_at":null,"author_association":"NONE","body":"[simple-peer](https://github.com/feross/simple-peer) can't get remote IP and port after wrtc upgrade to 0.0.63 from 0.0.62 (https://github.com/nazar-pc/webtorrent-dht/issues/3).\r\n\r\nThe issue I found is that after opening data channel `getStats()` still returns `googCandidatePair` with `googActiveConnection: false`.\r\n\r\nI'm not sure if I've mentioned correct pieces, but without `googActiveConnection: true` simple-peer doesn't fill corresponding information.\r\n\r\nHere are related lines in simple-peer: https://github.com/feross/simple-peer/blob/e64fe5c459064ca941c90f8fb4aae241cd820cfd/index.js#L552-L634\r\n\r\nAnd here is what `getStats()` item looks like at the time when it reaches `(item.type === 'googCandidatePair' && item.googActiveConnection === 'true') ||`:\r\n```\r\n{\r\n\t\"googActiveConnection\"    : \"false\",\r\n\t\"bytesReceived\"           : \"157\",\r\n\t\"bytesSent\"               : \"0\",\r\n\t\"packetsSent\"             : \"0\",\r\n\t\"googReadable\"            : \"true\",\r\n\t\"requestsSent\"            : \"0\",\r\n\t\"consentRequestsSent\"     : \"0\",\r\n\t\"responsesSent\"           : \"1\",\r\n\t\"requestsReceived\"        : \"1\",\r\n\t\"responsesReceived\"       : \"0\",\r\n\t\"googChannelId\"           : \"Channel-data-1\",\r\n\t\"googLocalAddress\"        : \"192.168.1.2:55586\",\r\n\t\"localCandidateId\"        : \"Cand-gh513x9K\",\r\n\t\"googLocalCandidateType\"  : \"local\",\r\n\t\"googRemoteAddress\"       : \"192.168.1.2:51631\",\r\n\t\"remoteCandidateId\"       : \"Cand-LU2PJIBn\",\r\n\t\"googRemoteCandidateType\" : \"prflx\",\r\n\t\"googRtt\"                 : \"3000\",\r\n\t\"packetsDiscardedOnSend\"  : \"0\",\r\n\t\"googTransportType\"       : \"udp\",\r\n\t\"googWritable\"            : \"false\",\r\n\t\"type\"                    : \"googCandidatePair\",\r\n\t\"timestamp\"               : 1511793755262.099\r\n}\r\n```\r\n\r\nInterestingly, if I stop it at `self._connecting = true` for some time in Dev Tools's debugger, `googActiveConnection` gets flipped to `true` and everything works.\r\n\r\nLooks like there is a timing issue somewhere, I'm not very familiar with this projects, but `googActiveConnection: false` seems odd when there is an active working `RTCDataChannel`."},"comment":{"url":"https://api.github.com/repos/js-platform/node-webrtc/issues/comments/347292023","html_url":"https://github.com/js-platform/node-webrtc/issues/339#issuecomment-347292023","issue_url":"https://api.github.com/repos/js-platform/node-webrtc/issues/339","id":347292023,"user":{"login":"markandrus","id":359154,"avatar_url":"https://avatars3.githubusercontent.com/u/359154?v=4","gravatar_id":"","url":"https://api.github.com/users/markandrus","html_url":"https://github.com/markandrus","followers_url":"https://api.github.com/users/markandrus/followers","following_url":"https://api.github.com/users/markandrus/following{/other_user}","gists_url":"https://api.github.com/users/markandrus/gists{/gist_id}","starred_url":"https://api.github.com/users/markandrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markandrus/subscriptions","organizations_url":"https://api.github.com/users/markandrus/orgs","repos_url":"https://api.github.com/users/markandrus/repos","events_url":"https://api.github.com/users/markandrus/events{/privacy}","received_events_url":"https://api.github.com/users/markandrus/received_events","type":"User","site_admin":false},"created_at":"2017-11-27T19:10:30Z","updated_at":"2017-11-27T19:10:30Z","author_association":"CONTRIBUTOR","body":"@nazar-pc after skimming [webrtc-pc](https://w3c.github.io/webrtc-pc) and [webrtc-stats](https://w3c.github.io/webrtc-stats), there don't seem to be any hard guarantees around what is available in the (W3C-specced) `getStats` results in relation to the current state of the RTCPeerConnection. Granted, node-webrtc is still raising the legacy stats from Chrome, and not the W3C-specced stats, but the \"googCandidatePair\" stat and its \"googActiveConnection\" property roughly correspond to the [RTCIceCandidatePairStats](https://w3c.github.io/webrtc-stats/#candidatepair-dict*), the [RTCTransportStats](https://w3c.github.io/webrtc-stats/#transportstats-dict*), and the RTCTransportStats' [`selectedCandidatePairId`](https://w3c.github.io/webrtc-stats/#dom-rtctransportstats-selectedcandidatepairid) property. If I rewrite the JSFiddle to use these standard stats, the results are still non-deterministic: https://jsfiddle.net/q4zbpx3g/\r\n\r\nI'd feel uncomfortable trying to re-implement the M50 behavior in node-webrtc, since it seems undefined with respect to the standard (which I'd like this project to move towards). What do you think about adding some code to simple-peer to poll (like `setInterval`) the `getStats` results?"}}
{"actor":{"display_login":"markandrus"}}