{"action":"created","comment":{"url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/comments/214994454","pull_request_review_id":152160073,"id":214994454,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDk5NDQ1NA==","diff_hunk":"@@ -0,0 +1,83 @@\n+import * as firebase from \"firebase\";\n+import { AppMode } from \"../models/stores\";\n+\n+export type IDBConnectOptions = IDBAuthConnectOptions | IDBNonAuthConnectOptions;\n+export interface IDBAuthConnectOptions {\n+  appMode: \"authed\";\n+  rawFirebaseToken: string;\n+}\n+export interface IDBNonAuthConnectOptions {\n+  appMode: \"dev\" | \"test\";\n+}\n+\n+export class DB {\n+  private appMode: AppMode;\n+  private firebaseUser: firebase.User | null = null;\n+\n+  public get isConnected() {\n+    return this.firebaseUser !== null;\n+  }\n+\n+  public connect(options: IDBConnectOptions) {\n+    return new Promise<boolean>((resolve, reject) => {\n+      if (this.isConnected) {\n+        reject(\"Already connected to database!\");","path":"src/lib/db.ts","position":24,"original_position":24,"commit_id":"31d6968db91bd7c01ea628a2e20ba9b5f371ea2d","original_commit_id":"31d6968db91bd7c01ea628a2e20ba9b5f371ea2d","user":{"login":"kswenson","id":235234,"node_id":"MDQ6VXNlcjIzNTIzNA==","avatar_url":"https://avatars0.githubusercontent.com/u/235234?v=4","gravatar_id":"","url":"https://api.github.com/users/kswenson","html_url":"https://github.com/kswenson","followers_url":"https://api.github.com/users/kswenson/followers","following_url":"https://api.github.com/users/kswenson/following{/other_user}","gists_url":"https://api.github.com/users/kswenson/gists{/gist_id}","starred_url":"https://api.github.com/users/kswenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kswenson/subscriptions","organizations_url":"https://api.github.com/users/kswenson/orgs","repos_url":"https://api.github.com/users/kswenson/repos","events_url":"https://api.github.com/users/kswenson/events{/privacy}","received_events_url":"https://api.github.com/users/kswenson/received_events","type":"User","site_admin":false},"body":"Is rejecting preferable in this case? Logically, it would seem one could just as easily resolve on the grounds that the desired condition is already met.","created_at":"2018-09-04T17:07:03Z","updated_at":"2018-09-04T17:16:51Z","html_url":"https://github.com/concord-consortium/collaborative-learning/pull/14#discussion_r214994454","pull_request_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/comments/214994454"},"html":{"href":"https://github.com/concord-consortium/collaborative-learning/pull/14#discussion_r214994454"},"pull_request":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14","id":213006940,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMDA2OTQw","html_url":"https://github.com/concord-consortium/collaborative-learning/pull/14","diff_url":"https://github.com/concord-consortium/collaborative-learning/pull/14.diff","patch_url":"https://github.com/concord-consortium/collaborative-learning/pull/14.patch","issue_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/14","number":14,"state":"open","locked":false,"title":"Added Firebase setup and authentication and start of schema document [#160170658]","user":{"login":"dougmartin","id":112938,"node_id":"MDQ6VXNlcjExMjkzOA==","avatar_url":"https://avatars3.githubusercontent.com/u/112938?v=4","gravatar_id":"","url":"https://api.github.com/users/dougmartin","html_url":"https://github.com/dougmartin","followers_url":"https://api.github.com/users/dougmartin/followers","following_url":"https://api.github.com/users/dougmartin/following{/other_user}","gists_url":"https://api.github.com/users/dougmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/dougmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougmartin/subscriptions","organizations_url":"https://api.github.com/users/dougmartin/orgs","repos_url":"https://api.github.com/users/dougmartin/repos","events_url":"https://api.github.com/users/dougmartin/events{/privacy}","received_events_url":"https://api.github.com/users/dougmartin/received_events","type":"User","site_admin":false},"body":"Also renamed `devMode` parameter from boolean to `appMode` which is a string of either `dev`, `test` or `authed`.","created_at":"2018-09-04T14:57:17Z","updated_at":"2018-09-04T17:16:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15ebcc4e045a7f0fb10ef390c481417d60d7dc43","assignee":null,"assignees":[],"requested_reviewers":[{"login":"DALove1025","id":1869066,"node_id":"MDQ6VXNlcjE4NjkwNjY=","avatar_url":"https://avatars3.githubusercontent.com/u/1869066?v=4","gravatar_id":"","url":"https://api.github.com/users/DALove1025","html_url":"https://github.com/DALove1025","followers_url":"https://api.github.com/users/DALove1025/followers","following_url":"https://api.github.com/users/DALove1025/following{/other_user}","gists_url":"https://api.github.com/users/DALove1025/gists{/gist_id}","starred_url":"https://api.github.com/users/DALove1025/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DALove1025/subscriptions","organizations_url":"https://api.github.com/users/DALove1025/orgs","repos_url":"https://api.github.com/users/DALove1025/repos","events_url":"https://api.github.com/users/DALove1025/events{/privacy}","received_events_url":"https://api.github.com/users/DALove1025/received_events","type":"User","site_admin":false},{"login":"ekosmin","id":3824039,"node_id":"MDQ6VXNlcjM4MjQwMzk=","avatar_url":"https://avatars1.githubusercontent.com/u/3824039?v=4","gravatar_id":"","url":"https://api.github.com/users/ekosmin","html_url":"https://github.com/ekosmin","followers_url":"https://api.github.com/users/ekosmin/followers","following_url":"https://api.github.com/users/ekosmin/following{/other_user}","gists_url":"https://api.github.com/users/ekosmin/gists{/gist_id}","starred_url":"https://api.github.com/users/ekosmin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekosmin/subscriptions","organizations_url":"https://api.github.com/users/ekosmin/orgs","repos_url":"https://api.github.com/users/ekosmin/repos","events_url":"https://api.github.com/users/ekosmin/events{/privacy}","received_events_url":"https://api.github.com/users/ekosmin/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14/commits","review_comments_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14/comments","review_comment_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/comments{/number}","comments_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/14/comments","statuses_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/statuses/31d6968db91bd7c01ea628a2e20ba9b5f371ea2d","head":{"label":"concord-consortium:160170658-firebase-setup","ref":"160170658-firebase-setup","sha":"31d6968db91bd7c01ea628a2e20ba9b5f371ea2d","user":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":145902554,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU5MDI1NTQ=","name":"collaborative-learning","full_name":"concord-consortium/collaborative-learning","owner":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/concord-consortium/collaborative-learning","description":null,"fork":false,"url":"https://api.github.com/repos/concord-consortium/collaborative-learning","forks_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/forks","keys_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/teams","hooks_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/hooks","issue_events_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/events{/number}","events_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/events","assignees_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/assignees{/user}","branches_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/branches{/branch}","tags_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/tags","blobs_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/statuses/{sha}","languages_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/languages","stargazers_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/stargazers","contributors_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/contributors","subscribers_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/subscribers","subscription_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/subscription","commits_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/contents/{+path}","compare_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/merges","archive_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/downloads","issues_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues{/number}","pulls_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls{/number}","milestones_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/milestones{/number}","notifications_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/labels{/name}","releases_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/releases{/id}","deployments_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/deployments","created_at":"2018-08-23T20:16:15Z","updated_at":"2018-09-04T13:31:03Z","pushed_at":"2018-09-04T14:57:18Z","git_url":"git://github.com/concord-consortium/collaborative-learning.git","ssh_url":"git@github.com:concord-consortium/collaborative-learning.git","clone_url":"https://github.com/concord-consortium/collaborative-learning.git","svn_url":"https://github.com/concord-consortium/collaborative-learning","homepage":null,"size":397,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"concord-consortium:master","ref":"master","sha":"70000c6103945e4633285e743913b8070fbc8e64","user":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"repo":{"id":145902554,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU5MDI1NTQ=","name":"collaborative-learning","full_name":"concord-consortium/collaborative-learning","owner":{"login":"concord-consortium","id":319219,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxOTIxOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/319219?v=4","gravatar_id":"","url":"https://api.github.com/users/concord-consortium","html_url":"https://github.com/concord-consortium","followers_url":"https://api.github.com/users/concord-consortium/followers","following_url":"https://api.github.com/users/concord-consortium/following{/other_user}","gists_url":"https://api.github.com/users/concord-consortium/gists{/gist_id}","starred_url":"https://api.github.com/users/concord-consortium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concord-consortium/subscriptions","organizations_url":"https://api.github.com/users/concord-consortium/orgs","repos_url":"https://api.github.com/users/concord-consortium/repos","events_url":"https://api.github.com/users/concord-consortium/events{/privacy}","received_events_url":"https://api.github.com/users/concord-consortium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/concord-consortium/collaborative-learning","description":null,"fork":false,"url":"https://api.github.com/repos/concord-consortium/collaborative-learning","forks_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/forks","keys_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/teams","hooks_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/hooks","issue_events_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/events{/number}","events_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/events","assignees_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/assignees{/user}","branches_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/branches{/branch}","tags_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/tags","blobs_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/refs{/sha}","trees_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/statuses/{sha}","languages_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/languages","stargazers_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/stargazers","contributors_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/contributors","subscribers_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/subscribers","subscription_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/subscription","commits_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/commits{/sha}","git_commits_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/git/commits{/sha}","comments_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/comments{/number}","issue_comment_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/comments{/number}","contents_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/contents/{+path}","compare_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/merges","archive_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/downloads","issues_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues{/number}","pulls_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls{/number}","milestones_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/milestones{/number}","notifications_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/labels{/name}","releases_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/releases{/id}","deployments_url":"https://api.github.com/repos/concord-consortium/collaborative-learning/deployments","created_at":"2018-08-23T20:16:15Z","updated_at":"2018-09-04T13:31:03Z","pushed_at":"2018-09-04T14:57:18Z","git_url":"git://github.com/concord-consortium/collaborative-learning.git","ssh_url":"git@github.com:concord-consortium/collaborative-learning.git","clone_url":"https://github.com/concord-consortium/collaborative-learning.git","svn_url":"https://github.com/concord-consortium/collaborative-learning","homepage":null,"size":397,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14"},"html":{"href":"https://github.com/concord-consortium/collaborative-learning/pull/14"},"issue":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/14"},"comments":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/concord-consortium/collaborative-learning/statuses/31d6968db91bd7c01ea628a2e20ba9b5f371ea2d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kswenson"}}