{"action":"created","comment":{"url":"https://api.github.com/repos/casetext/firewatch/pulls/comments/73396267","id":73396267,"diff_hunk":"@@ -55,30 +59,42 @@ FirebaseWatcher.prototype.connect = function() {\n \n \t\tif (!isNaN(msg)) {\n \t\t\tif (self.state == IGNORE_NEXT_STREAM) {\n-\t\t\t\tself._rootReceived = Date.now();\n-\t\t\t\tself.emit('serverReady', self._rootReceived - self._rootRequested)\n+\t\t\t\tself.log('S: IGNORED_STREAM');","path":"watch.js","position":33,"original_position":33,"commit_id":"dc37f8206fce302357fa41075ffb1e6f13bb6bf2","original_commit_id":"dc37f8206fce302357fa41075ffb1e6f13bb6bf2","user":{"login":"daguej","id":354349,"avatar_url":"https://avatars.githubusercontent.com/u/354349?v=3","gravatar_id":"","url":"https://api.github.com/users/daguej","html_url":"https://github.com/daguej","followers_url":"https://api.github.com/users/daguej/followers","following_url":"https://api.github.com/users/daguej/following{/other_user}","gists_url":"https://api.github.com/users/daguej/gists{/gist_id}","starred_url":"https://api.github.com/users/daguej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daguej/subscriptions","organizations_url":"https://api.github.com/users/daguej/orgs","repos_url":"https://api.github.com/users/daguej/repos","events_url":"https://api.github.com/users/daguej/events{/privacy}","received_events_url":"https://api.github.com/users/daguej/received_events","type":"User","site_admin":false},"body":"They're all behind a `debug` option, so they're all no-ops by default.\r\n\r\nI found myself constantly adding these in and then deleting them every time I've needed to fix something, so I wanted to make life easier by having this code in permanently.","created_at":"2016-08-03T18:45:50Z","updated_at":"2016-08-03T18:45:50Z","html_url":"https://github.com/casetext/firewatch/pull/2#discussion_r73396267","pull_request_url":"https://api.github.com/repos/casetext/firewatch/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/casetext/firewatch/pulls/comments/73396267"},"html":{"href":"https://github.com/casetext/firewatch/pull/2#discussion_r73396267"},"pull_request":{"href":"https://api.github.com/repos/casetext/firewatch/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/casetext/firewatch/pulls/2","id":79956391,"html_url":"https://github.com/casetext/firewatch/pull/2","diff_url":"https://github.com/casetext/firewatch/pull/2.diff","patch_url":"https://github.com/casetext/firewatch/pull/2.patch","issue_url":"https://api.github.com/repos/casetext/firewatch/issues/2","number":2,"state":"open","locked":false,"title":"Only request listeners on interesting paths","user":{"login":"daguej","id":354349,"avatar_url":"https://avatars.githubusercontent.com/u/354349?v=3","gravatar_id":"","url":"https://api.github.com/users/daguej","html_url":"https://github.com/daguej","followers_url":"https://api.github.com/users/daguej/followers","following_url":"https://api.github.com/users/daguej/following{/other_user}","gists_url":"https://api.github.com/users/daguej/gists{/gist_id}","starred_url":"https://api.github.com/users/daguej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daguej/subscriptions","organizations_url":"https://api.github.com/users/daguej/orgs","repos_url":"https://api.github.com/users/daguej/repos","events_url":"https://api.github.com/users/daguej/events{/privacy}","received_events_url":"https://api.github.com/users/daguej/received_events","type":"User","site_admin":false},"body":"Previously, firewatch requested a listener on root (`/`) and filtered data updates based on callbacks registered with `watch()`.  This was the easy/lazy implementation, but it worked.\r\n\r\n...until it didn't.  Firebase made server-side changes that broke this approach (at least for us).  Requesting a listener on root of a large firebase began to result in an **immediate** and summary disconnection from the server.\r\n\r\nThis fixes the problem by only asking for listeners on paths we're interested in (passed to `watch`).  This functionality is smart:\r\n\r\n- All calls to `watch()` are batched together and listeners are collapsed where possible.\r\n- If a path is `unwatch`ed, the listener is deregistered.\r\n- When a batch of `watch` and `unwatch` operations is processed, we make the smallest number of listener registration changes possible.  This means things like [firesentry](https://github.com/casetext/firesentry) can do code reloading with minimal network impact.","created_at":"2016-08-03T18:36:25Z","updated_at":"2016-08-03T18:45:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7dc2829e6f56a433af2944990b04c529da4c6434","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/casetext/firewatch/pulls/2/commits","review_comments_url":"https://api.github.com/repos/casetext/firewatch/pulls/2/comments","review_comment_url":"https://api.github.com/repos/casetext/firewatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/casetext/firewatch/issues/2/comments","statuses_url":"https://api.github.com/repos/casetext/firewatch/statuses/dc37f8206fce302357fa41075ffb1e6f13bb6bf2","head":{"label":"casetext:v2","ref":"v2","sha":"dc37f8206fce302357fa41075ffb1e6f13bb6bf2","user":{"login":"casetext","id":5018617,"avatar_url":"https://avatars.githubusercontent.com/u/5018617?v=3","gravatar_id":"","url":"https://api.github.com/users/casetext","html_url":"https://github.com/casetext","followers_url":"https://api.github.com/users/casetext/followers","following_url":"https://api.github.com/users/casetext/following{/other_user}","gists_url":"https://api.github.com/users/casetext/gists{/gist_id}","starred_url":"https://api.github.com/users/casetext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casetext/subscriptions","organizations_url":"https://api.github.com/users/casetext/orgs","repos_url":"https://api.github.com/users/casetext/repos","events_url":"https://api.github.com/users/casetext/events{/privacy}","received_events_url":"https://api.github.com/users/casetext/received_events","type":"Organization","site_admin":false},"repo":{"id":56724834,"name":"firewatch","full_name":"casetext/firewatch","owner":{"login":"casetext","id":5018617,"avatar_url":"https://avatars.githubusercontent.com/u/5018617?v=3","gravatar_id":"","url":"https://api.github.com/users/casetext","html_url":"https://github.com/casetext","followers_url":"https://api.github.com/users/casetext/followers","following_url":"https://api.github.com/users/casetext/following{/other_user}","gists_url":"https://api.github.com/users/casetext/gists{/gist_id}","starred_url":"https://api.github.com/users/casetext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casetext/subscriptions","organizations_url":"https://api.github.com/users/casetext/orgs","repos_url":"https://api.github.com/users/casetext/repos","events_url":"https://api.github.com/users/casetext/events{/privacy}","received_events_url":"https://api.github.com/users/casetext/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/casetext/firewatch","description":"Watch a Firebase for changes","fork":false,"url":"https://api.github.com/repos/casetext/firewatch","forks_url":"https://api.github.com/repos/casetext/firewatch/forks","keys_url":"https://api.github.com/repos/casetext/firewatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/casetext/firewatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/casetext/firewatch/teams","hooks_url":"https://api.github.com/repos/casetext/firewatch/hooks","issue_events_url":"https://api.github.com/repos/casetext/firewatch/issues/events{/number}","events_url":"https://api.github.com/repos/casetext/firewatch/events","assignees_url":"https://api.github.com/repos/casetext/firewatch/assignees{/user}","branches_url":"https://api.github.com/repos/casetext/firewatch/branches{/branch}","tags_url":"https://api.github.com/repos/casetext/firewatch/tags","blobs_url":"https://api.github.com/repos/casetext/firewatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/casetext/firewatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/casetext/firewatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/casetext/firewatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/casetext/firewatch/statuses/{sha}","languages_url":"https://api.github.com/repos/casetext/firewatch/languages","stargazers_url":"https://api.github.com/repos/casetext/firewatch/stargazers","contributors_url":"https://api.github.com/repos/casetext/firewatch/contributors","subscribers_url":"https://api.github.com/repos/casetext/firewatch/subscribers","subscription_url":"https://api.github.com/repos/casetext/firewatch/subscription","commits_url":"https://api.github.com/repos/casetext/firewatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/casetext/firewatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/casetext/firewatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/casetext/firewatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/casetext/firewatch/contents/{+path}","compare_url":"https://api.github.com/repos/casetext/firewatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/casetext/firewatch/merges","archive_url":"https://api.github.com/repos/casetext/firewatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/casetext/firewatch/downloads","issues_url":"https://api.github.com/repos/casetext/firewatch/issues{/number}","pulls_url":"https://api.github.com/repos/casetext/firewatch/pulls{/number}","milestones_url":"https://api.github.com/repos/casetext/firewatch/milestones{/number}","notifications_url":"https://api.github.com/repos/casetext/firewatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/casetext/firewatch/labels{/name}","releases_url":"https://api.github.com/repos/casetext/firewatch/releases{/id}","deployments_url":"https://api.github.com/repos/casetext/firewatch/deployments","created_at":"2016-04-20T22:23:03Z","updated_at":"2016-04-27T23:55:22Z","pushed_at":"2016-08-03T18:36:25Z","git_url":"git://github.com/casetext/firewatch.git","ssh_url":"git@github.com:casetext/firewatch.git","clone_url":"https://github.com/casetext/firewatch.git","svn_url":"https://github.com/casetext/firewatch","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"casetext:master","ref":"master","sha":"0248be2169b44a3b0ecaa2fa7e7d10b5f676dda4","user":{"login":"casetext","id":5018617,"avatar_url":"https://avatars.githubusercontent.com/u/5018617?v=3","gravatar_id":"","url":"https://api.github.com/users/casetext","html_url":"https://github.com/casetext","followers_url":"https://api.github.com/users/casetext/followers","following_url":"https://api.github.com/users/casetext/following{/other_user}","gists_url":"https://api.github.com/users/casetext/gists{/gist_id}","starred_url":"https://api.github.com/users/casetext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casetext/subscriptions","organizations_url":"https://api.github.com/users/casetext/orgs","repos_url":"https://api.github.com/users/casetext/repos","events_url":"https://api.github.com/users/casetext/events{/privacy}","received_events_url":"https://api.github.com/users/casetext/received_events","type":"Organization","site_admin":false},"repo":{"id":56724834,"name":"firewatch","full_name":"casetext/firewatch","owner":{"login":"casetext","id":5018617,"avatar_url":"https://avatars.githubusercontent.com/u/5018617?v=3","gravatar_id":"","url":"https://api.github.com/users/casetext","html_url":"https://github.com/casetext","followers_url":"https://api.github.com/users/casetext/followers","following_url":"https://api.github.com/users/casetext/following{/other_user}","gists_url":"https://api.github.com/users/casetext/gists{/gist_id}","starred_url":"https://api.github.com/users/casetext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/casetext/subscriptions","organizations_url":"https://api.github.com/users/casetext/orgs","repos_url":"https://api.github.com/users/casetext/repos","events_url":"https://api.github.com/users/casetext/events{/privacy}","received_events_url":"https://api.github.com/users/casetext/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/casetext/firewatch","description":"Watch a Firebase for changes","fork":false,"url":"https://api.github.com/repos/casetext/firewatch","forks_url":"https://api.github.com/repos/casetext/firewatch/forks","keys_url":"https://api.github.com/repos/casetext/firewatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/casetext/firewatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/casetext/firewatch/teams","hooks_url":"https://api.github.com/repos/casetext/firewatch/hooks","issue_events_url":"https://api.github.com/repos/casetext/firewatch/issues/events{/number}","events_url":"https://api.github.com/repos/casetext/firewatch/events","assignees_url":"https://api.github.com/repos/casetext/firewatch/assignees{/user}","branches_url":"https://api.github.com/repos/casetext/firewatch/branches{/branch}","tags_url":"https://api.github.com/repos/casetext/firewatch/tags","blobs_url":"https://api.github.com/repos/casetext/firewatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/casetext/firewatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/casetext/firewatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/casetext/firewatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/casetext/firewatch/statuses/{sha}","languages_url":"https://api.github.com/repos/casetext/firewatch/languages","stargazers_url":"https://api.github.com/repos/casetext/firewatch/stargazers","contributors_url":"https://api.github.com/repos/casetext/firewatch/contributors","subscribers_url":"https://api.github.com/repos/casetext/firewatch/subscribers","subscription_url":"https://api.github.com/repos/casetext/firewatch/subscription","commits_url":"https://api.github.com/repos/casetext/firewatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/casetext/firewatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/casetext/firewatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/casetext/firewatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/casetext/firewatch/contents/{+path}","compare_url":"https://api.github.com/repos/casetext/firewatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/casetext/firewatch/merges","archive_url":"https://api.github.com/repos/casetext/firewatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/casetext/firewatch/downloads","issues_url":"https://api.github.com/repos/casetext/firewatch/issues{/number}","pulls_url":"https://api.github.com/repos/casetext/firewatch/pulls{/number}","milestones_url":"https://api.github.com/repos/casetext/firewatch/milestones{/number}","notifications_url":"https://api.github.com/repos/casetext/firewatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/casetext/firewatch/labels{/name}","releases_url":"https://api.github.com/repos/casetext/firewatch/releases{/id}","deployments_url":"https://api.github.com/repos/casetext/firewatch/deployments","created_at":"2016-04-20T22:23:03Z","updated_at":"2016-04-27T23:55:22Z","pushed_at":"2016-08-03T18:36:25Z","git_url":"git://github.com/casetext/firewatch.git","ssh_url":"git@github.com:casetext/firewatch.git","clone_url":"https://github.com/casetext/firewatch.git","svn_url":"https://github.com/casetext/firewatch","homepage":null,"size":21,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/casetext/firewatch/pulls/2"},"html":{"href":"https://github.com/casetext/firewatch/pull/2"},"issue":{"href":"https://api.github.com/repos/casetext/firewatch/issues/2"},"comments":{"href":"https://api.github.com/repos/casetext/firewatch/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/casetext/firewatch/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/casetext/firewatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/casetext/firewatch/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/casetext/firewatch/statuses/dc37f8206fce302357fa41075ffb1e6f13bb6bf2"}}}}
{"actor":{"display_login":"daguej"}}