GitHub PullRequestReviewCommentEvent at 2014-04-15 04:05:42
Repository: meteor
Actor: n1mmy
Payload: {"comment":{"url":"https://api.github.com/repos/meteor/meteor/pulls/comments/11619554","id":11619554,"diff_hunk":"@@ -658,6 +665,28 @@ _.extend(Connection.prototype, {\n       };\n     })();\n \n+    var enclosing = DDP._CurrentInvocation.get();\n+    var alreadyInSimulation = enclosing && enclosing.isSimulation;\n+\n+    // Lazily generate a randomSeed, only if it is requested by the stub.\n+    // The random streams only have utility if they're used on both the client\n+    // and the server; if the client doesn't generate any 'random' values\n+    // then we don't expect the server to generate any either.\n+    // Less commonly, the server may perform different actions to the client,\n+    // and may in fact generate values where the client did not, but we don't\n+    // have any client-side values to match, so even here we may as well just\n+    // use a random seed on the server.  In that case, we don't pass the\n+    // randomSeed to save bandwidth, and we don't even generate it to save a\n+    // bit of CPU and to avoid consuming entropy.\n+    var randomSeedGenerator = {};\n+    randomSeedGenerator.generate = function () {\n+      var self = randomSeedGenerator;\n+      if (!self.generated) {","path":"packages/livedata/livedata_connection.js","position":34,"original_position":34,"commit_id":"16461343fbcaf6e48fa53089a7eae752ad2c5c1a","original_commit_id":"16461343fbcaf6e48fa53089a7eae752ad2c5c1a","user":{"login":"n1mmy","id":284356,"avatar_url":"https://avatars.githubusercontent.com/u/284356?","gravatar_id":"4df03bb0011207cb8b66d7ca3378272c","url":"https://api.github.com/users/n1mmy","html_url":"https://github.com/n1mmy","followers_url":"https://api.github.com/users/n1mmy/followers","following_url":"https://api.github.com/users/n1mmy/following{/other_user}","gists_url":"https://api.github.com/users/n1mmy/gists{/gist_id}","starred_url":"https://api.github.com/users/n1mmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n1mmy/subscriptions","organizations_url":"https://api.github.com/users/n1mmy/orgs","repos_url":"https://api.github.com/users/n1mmy/repos","events_url":"https://api.github.com/users/n1mmy/events{/privacy}","received_events_url":"https://api.github.com/users/n1mmy/received_events","type":"User","site_admin":false},"body":"I'd initialized to and compare against null instead. It happens that makeRpcSeed always returns a nonempty string but you could imagine a world where empty string or 0 was a valid seed.","created_at":"2014-04-15T04:05:42Z","updated_at":"2014-04-15T04:05:42Z","html_url":"https://github.com/meteor/meteor/pull/1901#discussion_r11619554","pull_request_url":"https://api.github.com/repos/meteor/meteor/pulls/1901","_links":{"self":{"href":"https://api.github.com/repos/meteor/meteor/pulls/comments/11619554"},"html":{"href":"https://github.com/meteor/meteor/pull/1901#discussion_r11619554"},"pull_request":{"href":"https://api.github.com/repos/meteor/meteor/pulls/1901"}}}}