payload: {"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/335676200","pull_request_review_id":302834031,"id":335676200,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzNTY3NjIwMA==","diff_hunk":"@@ -262,33 +262,51 @@ FirebaseStorage.readRecords = function(\n ) {\n   tableName = fixTableName(tableName, onError);\n \n-  const countersRef = getProjectDatabase().child('counters/tables/');\n-  // First, check if table exists using counters/tables/ as source of truth\n-  countersRef.once('value', countersSnapshot => {\n-    if (!countersSnapshot.val() || !countersSnapshot.val()[tableName]) {\n-      // Table doesn't exist. Return null instead of [] so we can show an error\n+  let channelRef;\n+  // First check both current tables and project tables\n+  Promise.all([\n+    getProjectDatabase()","path":"apps/src/storage/firebaseStorage.js","position":12,"original_position":12,"commit_id":"c3aec7b25ab639a847cd9075fc99e452613d11c2","original_commit_id":"c3aec7b25ab639a847cd9075fc99e452613d11c2","user":{"login":"jmkulwik","id":8324574,"node_id":"MDQ6VXNlcjgzMjQ1NzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/8324574?v=4","gravatar_id":"","url":"https://api.github.com/users/jmkulwik","html_url":"https://github.com/jmkulwik","followers_url":"https://api.github.com/users/jmkulwik/followers","following_url":"https://api.github.com/users/jmkulwik/following{/other_user}","gists_url":"https://api.github.com/users/jmkulwik/gists{/gist_id}","starred_url":"https://api.github.com/users/jmkulwik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmkulwik/subscriptions","organizations_url":"https://api.github.com/users/jmkulwik/orgs","repos_url":"https://api.github.com/users/jmkulwik/repos","events_url":"https://api.github.com/users/jmkulwik/events{/privacy}","received_events_url":"https://api.github.com/users/jmkulwik/received_events","type":"User","site_admin":false},"body":"Since these two sections are nearly identical, mind moving them to a functions?","created_at":"2019-10-16T19:50:39Z","updated_at":"2019-10-16T19:50:39Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/31299#discussion_r335676200","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/335676200"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/31299#discussion_r335676200"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299","id":328576913,"node_id":"MDExOlB1bGxSZXF1ZXN0MzI4NTc2OTEz","html_url":"https://github.com/code-dot-org/code-dot-org/pull/31299","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/31299.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/31299.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/31299","number":31299,"state":"open","locked":false,"title":"[Applab Datasets] Make readRecords work with current tables","user":{"login":"ajpal","id":8787187,"node_id":"MDQ6VXNlcjg3ODcxODc=","avatar_url":"https://avatars3.githubusercontent.com/u/8787187?v=4","gravatar_id":"","url":"https://api.github.com/users/ajpal","html_url":"https://github.com/ajpal","followers_url":"https://api.github.com/users/ajpal/followers","following_url":"https://api.github.com/users/ajpal/following{/other_user}","gists_url":"https://api.github.com/users/ajpal/gists{/gist_id}","starred_url":"https://api.github.com/users/ajpal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajpal/subscriptions","organizations_url":"https://api.github.com/users/ajpal/orgs","repos_url":"https://api.github.com/users/ajpal/repos","events_url":"https://api.github.com/users/ajpal/events{/privacy}","received_events_url":"https://api.github.com/users/ajpal/received_events","type":"User","site_admin":false},"body":"# Description\r\n`readRecords` currently does not work with current tables because it only looks for the data in the project channel. This change depends on #31298, which enforces that tables must be uniquely named. Given that, we can look for the table in both `/<channel>/current_tables/<tableName>` and `/<channel>/counters/tables/<tableName>`, and we are guaranteed to find at most one match.\r\n\r\nIf we find a match, then we can read the records from either the shared channel or the project channel as appropriate.\r\n![image](https://user-images.githubusercontent.com/8787187/66890568-6d0c4200-ef9b-11e9-8467-797eb5fb31af.png)\r\n\r\n\r\nIf we don't find a match, then we pass `null` to the callback so that we can display an error message:\r\n![image](https://user-images.githubusercontent.com/8787187/66890510-43ebb180-ef9b-11e9-852a-14e7c1832fd5.png)\r\n\r\n\r\n## Links\r\n\r\n<!--\r\n  Any relevant links to external resources; ie, specification documents, jira\r\n  items, related PRs, honeybadger errors, etc\r\n-->\r\n- [jira](https://codedotorg.atlassian.net/browse/STAR-760)\r\n\r\n## Testing story\r\n\r\n<!--\r\n  Does your change include appropriate tests?\r\n\r\n  If so, please describe how the tests included in this PR are sufficient\r\n\r\n  If not, please explain why this change does not need to be tested.\r\n-->\r\n\r\n# Reviewer Checklist:\r\n\r\n- [ ] Tests provide adequate coverage\r\n- [ ] Code is well-commented\r\n- [ ] New features are translatable or updates will not break translations\r\n- [ ] Relevant documentation has been added or updated\r\n- [ ] User impact is well-understood and desirable\r\n- [ ] Pull Request is labeled appropriately\r\n- [ ] Follow-up work items (including potential tech debt) are tracked and linked\r\n","created_at":"2019-10-16T05:31:48Z","updated_at":"2019-10-16T19:50:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25fe501fa54ef0685b10200c9714f773a9c3880f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":401725469,"node_id":"MDU6TGFiZWw0MDE3MjU0Njk=","url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels/star-labs","name":"star-labs","color":"ffa400","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/31299/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/c3aec7b25ab639a847cd9075fc99e452613d11c2","head":{"label":"code-dot-org:oct16-readrecords-current","ref":"oct16-readrecords-current","sha":"c3aec7b25ab639a847cd9075fc99e452613d11c2","user":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"node_id":"MDEwOlJlcG9zaXRvcnkyNDI1MDAwOQ==","name":"code-dot-org","full_name":"code-dot-org/code-dot-org","private":false,"owner":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2019-10-16T19:14:43Z","pushed_at":"2019-10-16T19:45:14Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":10198732,"stargazers_count":499,"watchers_count":499,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":290,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":177,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":290,"open_issues":177,"watchers":499,"default_branch":"staging"}},"base":{"label":"code-dot-org:oct15-readRecords-current","ref":"oct15-readRecords-current","sha":"76ca97d5614ab3b6c7bd85620823e6725caf5785","user":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"node_id":"MDEwOlJlcG9zaXRvcnkyNDI1MDAwOQ==","name":"code-dot-org","full_name":"code-dot-org/code-dot-org","private":false,"owner":{"login":"code-dot-org","id":5124627,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUxMjQ2Mjc=","avatar_url":"https://avatars2.githubusercontent.com/u/5124627?v=4","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","deployments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/deployments","created_at":"2014-09-20T00:46:11Z","updated_at":"2019-10-16T19:14:43Z","pushed_at":"2019-10-16T19:45:14Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":10198732,"stargazers_count":499,"watchers_count":499,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":290,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":177,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":290,"open_issues":177,"watchers":499,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/31299"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/31299"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/31299/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/31299/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/c3aec7b25ab639a847cd9075fc99e452613d11c2"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"jmkulwik"}}