{"action":"created","comment":{"url":"https://api.github.com/repos/rorysaur/quack/pulls/comments/27629447","id":27629447,"diff_hunk":"@@ -21,27 +22,33 @@ module.exports = {\n     var message = {\n       text: text,\n       timestamp: timestamp,\n-      user: 'guest' // hard-code for now\n+      user: 'guest', // hard-code for now\n+      clientId: UUID.generate()\n     };\n \n+    dispatch(ActionTypes.NEW_MESSAGE, message);","path":"js/actions/actions.js","position":17,"original_position":17,"commit_id":"7156179908255aaf4059f0babc8c0236eefcc6ec","original_commit_id":"7156179908255aaf4059f0babc8c0236eefcc6ec","user":{"login":"rorysaur","id":4686089,"avatar_url":"https://avatars.githubusercontent.com/u/4686089?v=3","gravatar_id":"","url":"https://api.github.com/users/rorysaur","html_url":"https://github.com/rorysaur","followers_url":"https://api.github.com/users/rorysaur/followers","following_url":"https://api.github.com/users/rorysaur/following{/other_user}","gists_url":"https://api.github.com/users/rorysaur/gists{/gist_id}","starred_url":"https://api.github.com/users/rorysaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rorysaur/subscriptions","organizations_url":"https://api.github.com/users/rorysaur/orgs","repos_url":"https://api.github.com/users/rorysaur/repos","events_url":"https://api.github.com/users/rorysaur/events{/privacy}","received_events_url":"https://api.github.com/users/rorysaur/received_events","type":"User","site_admin":false},"body":"can we call this CREATE_MESSAGE or CREATE_MESSAGE_PENDING, so that all 3 are like a family?","created_at":"2015-04-02T02:45:51Z","updated_at":"2015-04-02T02:45:51Z","html_url":"https://github.com/rorysaur/quack/pull/59#discussion_r27629447","pull_request_url":"https://api.github.com/repos/rorysaur/quack/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/rorysaur/quack/pulls/comments/27629447"},"html":{"href":"https://github.com/rorysaur/quack/pull/59#discussion_r27629447"},"pull_request":{"href":"https://api.github.com/repos/rorysaur/quack/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/rorysaur/quack/pulls/59","id":32478467,"html_url":"https://github.com/rorysaur/quack/pull/59","diff_url":"https://github.com/rorysaur/quack/pull/59.diff","patch_url":"https://github.com/rorysaur/quack/pull/59.patch","issue_url":"https://api.github.com/repos/rorysaur/quack/issues/59","number":59,"state":"open","locked":false,"title":"Optimism","user":{"login":"jacknoble","id":1051472,"avatar_url":"https://avatars.githubusercontent.com/u/1051472?v=3","gravatar_id":"","url":"https://api.github.com/users/jacknoble","html_url":"https://github.com/jacknoble","followers_url":"https://api.github.com/users/jacknoble/followers","following_url":"https://api.github.com/users/jacknoble/following{/other_user}","gists_url":"https://api.github.com/users/jacknoble/gists{/gist_id}","starred_url":"https://api.github.com/users/jacknoble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacknoble/subscriptions","organizations_url":"https://api.github.com/users/jacknoble/orgs","repos_url":"https://api.github.com/users/jacknoble/repos","events_url":"https://api.github.com/users/jacknoble/events{/privacy}","received_events_url":"https://api.github.com/users/jacknoble/received_events","type":"User","site_admin":false},"body":"https://github.com/rorysaur/quack/issues/37\r\n\r\nSummary:\r\n* When an a message is created it gets a client id. This is just a large hexadecimal string.\r\n* The NEW_MESSAGE event is triggered and the MessageStore adds the new message to a _pendingMessages object with it's clientId as the key. MessageStore emits change and the message is added to the ui.\r\n* Simultaneously the new message is pushed to firebase. For whatever reason firebase fires the child_added before the push has been confirmed. I'm guessing they're trying to be helpful but I don't want to be tied to firebase if we don't have to and their helpfulness doesn't make it clear how we're supposed to be able to tell incoming from outgoing messages. Anyway, in the mean time we ignore the child_added for messages that are _pending. We still add them if they're coming from the server.\r\n* Firebase confirms that the message was created and fires the MESSAGE_CREATED_SUCCESS event. The MessageStore then deletes the message from the _pendingMessages object (using the clientId) \r\n\r\n* There needs to be some indication of pending messages on the ui. Right now I gave them a red dashed border.\r\n\r\nTODO: Get rid of the red dashed border. Seriously, thats terrible UI. Also, the pending indicator probably shouldn't show up until like a second has gone by (illustrating connection issues). Finally, need to handle the failure callback. Problem is: under what cirumstances would that get called? @rorysaur or anyone?","created_at":"2015-04-02T02:28:57Z","updated_at":"2015-04-02T02:45:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb6b56f0577dfb70109323e98b9ebda313d4be4a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rorysaur/quack/pulls/59/commits","review_comments_url":"https://api.github.com/repos/rorysaur/quack/pulls/59/comments","review_comment_url":"https://api.github.com/repos/rorysaur/quack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rorysaur/quack/issues/59/comments","statuses_url":"https://api.github.com/repos/rorysaur/quack/statuses/7156179908255aaf4059f0babc8c0236eefcc6ec","head":{"label":"rorysaur:optimism","ref":"optimism","sha":"7156179908255aaf4059f0babc8c0236eefcc6ec","user":{"login":"rorysaur","id":4686089,"avatar_url":"https://avatars.githubusercontent.com/u/4686089?v=3","gravatar_id":"","url":"https://api.github.com/users/rorysaur","html_url":"https://github.com/rorysaur","followers_url":"https://api.github.com/users/rorysaur/followers","following_url":"https://api.github.com/users/rorysaur/following{/other_user}","gists_url":"https://api.github.com/users/rorysaur/gists{/gist_id}","starred_url":"https://api.github.com/users/rorysaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rorysaur/subscriptions","organizations_url":"https://api.github.com/users/rorysaur/orgs","repos_url":"https://api.github.com/users/rorysaur/repos","events_url":"https://api.github.com/users/rorysaur/events{/privacy}","received_events_url":"https://api.github.com/users/rorysaur/received_events","type":"User","site_admin":false},"repo":{"id":31999879,"name":"quack","full_name":"rorysaur/quack","owner":{"login":"rorysaur","id":4686089,"avatar_url":"https://avatars.githubusercontent.com/u/4686089?v=3","gravatar_id":"","url":"https://api.github.com/users/rorysaur","html_url":"https://github.com/rorysaur","followers_url":"https://api.github.com/users/rorysaur/followers","following_url":"https://api.github.com/users/rorysaur/following{/other_user}","gists_url":"https://api.github.com/users/rorysaur/gists{/gist_id}","starred_url":"https://api.github.com/users/rorysaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rorysaur/subscriptions","organizations_url":"https://api.github.com/users/rorysaur/orgs","repos_url":"https://api.github.com/users/rorysaur/repos","events_url":"https://api.github.com/users/rorysaur/events{/privacy}","received_events_url":"https://api.github.com/users/rorysaur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rorysaur/quack","description":"lil bro of Slack, using React and Flux","fork":false,"url":"https://api.github.com/repos/rorysaur/quack","forks_url":"https://api.github.com/repos/rorysaur/quack/forks","keys_url":"https://api.github.com/repos/rorysaur/quack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rorysaur/quack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rorysaur/quack/teams","hooks_url":"https://api.github.com/repos/rorysaur/quack/hooks","issue_events_url":"https://api.github.com/repos/rorysaur/quack/issues/events{/number}","events_url":"https://api.github.com/repos/rorysaur/quack/events","assignees_url":"https://api.github.com/repos/rorysaur/quack/assignees{/user}","branches_url":"https://api.github.com/repos/rorysaur/quack/branches{/branch}","tags_url":"https://api.github.com/repos/rorysaur/quack/tags","blobs_url":"https://api.github.com/repos/rorysaur/quack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rorysaur/quack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rorysaur/quack/git/refs{/sha}","trees_url":"https://api.github.com/repos/rorysaur/quack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rorysaur/quack/statuses/{sha}","languages_url":"https://api.github.com/repos/rorysaur/quack/languages","stargazers_url":"https://api.github.com/repos/rorysaur/quack/stargazers","contributors_url":"https://api.github.com/repos/rorysaur/quack/contributors","subscribers_url":"https://api.github.com/repos/rorysaur/quack/subscribers","subscription_url":"https://api.github.com/repos/rorysaur/quack/subscription","commits_url":"https://api.github.com/repos/rorysaur/quack/commits{/sha}","git_commits_url":"https://api.github.com/repos/rorysaur/quack/git/commits{/sha}","comments_url":"https://api.github.com/repos/rorysaur/quack/comments{/number}","issue_comment_url":"https://api.github.com/repos/rorysaur/quack/issues/comments{/number}","contents_url":"https://api.github.com/repos/rorysaur/quack/contents/{+path}","compare_url":"https://api.github.com/repos/rorysaur/quack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rorysaur/quack/merges","archive_url":"https://api.github.com/repos/rorysaur/quack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rorysaur/quack/downloads","issues_url":"https://api.github.com/repos/rorysaur/quack/issues{/number}","pulls_url":"https://api.github.com/repos/rorysaur/quack/pulls{/number}","milestones_url":"https://api.github.com/repos/rorysaur/quack/milestones{/number}","notifications_url":"https://api.github.com/repos/rorysaur/quack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rorysaur/quack/labels{/name}","releases_url":"https://api.github.com/repos/rorysaur/quack/releases{/id}","created_at":"2015-03-11T05:22:59Z","updated_at":"2015-04-01T04:17:36Z","pushed_at":"2015-04-02T02:28:58Z","git_url":"git://github.com/rorysaur/quack.git","ssh_url":"git@github.com:rorysaur/quack.git","clone_url":"https://github.com/rorysaur/quack.git","svn_url":"https://github.com/rorysaur/quack","homepage":null,"size":928,"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":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"base":{"label":"rorysaur:master","ref":"master","sha":"3fa20acf945047228df96cc578a3b38815575e0d","user":{"login":"rorysaur","id":4686089,"avatar_url":"https://avatars.githubusercontent.com/u/4686089?v=3","gravatar_id":"","url":"https://api.github.com/users/rorysaur","html_url":"https://github.com/rorysaur","followers_url":"https://api.github.com/users/rorysaur/followers","following_url":"https://api.github.com/users/rorysaur/following{/other_user}","gists_url":"https://api.github.com/users/rorysaur/gists{/gist_id}","starred_url":"https://api.github.com/users/rorysaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rorysaur/subscriptions","organizations_url":"https://api.github.com/users/rorysaur/orgs","repos_url":"https://api.github.com/users/rorysaur/repos","events_url":"https://api.github.com/users/rorysaur/events{/privacy}","received_events_url":"https://api.github.com/users/rorysaur/received_events","type":"User","site_admin":false},"repo":{"id":31999879,"name":"quack","full_name":"rorysaur/quack","owner":{"login":"rorysaur","id":4686089,"avatar_url":"https://avatars.githubusercontent.com/u/4686089?v=3","gravatar_id":"","url":"https://api.github.com/users/rorysaur","html_url":"https://github.com/rorysaur","followers_url":"https://api.github.com/users/rorysaur/followers","following_url":"https://api.github.com/users/rorysaur/following{/other_user}","gists_url":"https://api.github.com/users/rorysaur/gists{/gist_id}","starred_url":"https://api.github.com/users/rorysaur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rorysaur/subscriptions","organizations_url":"https://api.github.com/users/rorysaur/orgs","repos_url":"https://api.github.com/users/rorysaur/repos","events_url":"https://api.github.com/users/rorysaur/events{/privacy}","received_events_url":"https://api.github.com/users/rorysaur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rorysaur/quack","description":"lil bro of Slack, using React and Flux","fork":false,"url":"https://api.github.com/repos/rorysaur/quack","forks_url":"https://api.github.com/repos/rorysaur/quack/forks","keys_url":"https://api.github.com/repos/rorysaur/quack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rorysaur/quack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rorysaur/quack/teams","hooks_url":"https://api.github.com/repos/rorysaur/quack/hooks","issue_events_url":"https://api.github.com/repos/rorysaur/quack/issues/events{/number}","events_url":"https://api.github.com/repos/rorysaur/quack/events","assignees_url":"https://api.github.com/repos/rorysaur/quack/assignees{/user}","branches_url":"https://api.github.com/repos/rorysaur/quack/branches{/branch}","tags_url":"https://api.github.com/repos/rorysaur/quack/tags","blobs_url":"https://api.github.com/repos/rorysaur/quack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rorysaur/quack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rorysaur/quack/git/refs{/sha}","trees_url":"https://api.github.com/repos/rorysaur/quack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rorysaur/quack/statuses/{sha}","languages_url":"https://api.github.com/repos/rorysaur/quack/languages","stargazers_url":"https://api.github.com/repos/rorysaur/quack/stargazers","contributors_url":"https://api.github.com/repos/rorysaur/quack/contributors","subscribers_url":"https://api.github.com/repos/rorysaur/quack/subscribers","subscription_url":"https://api.github.com/repos/rorysaur/quack/subscription","commits_url":"https://api.github.com/repos/rorysaur/quack/commits{/sha}","git_commits_url":"https://api.github.com/repos/rorysaur/quack/git/commits{/sha}","comments_url":"https://api.github.com/repos/rorysaur/quack/comments{/number}","issue_comment_url":"https://api.github.com/repos/rorysaur/quack/issues/comments{/number}","contents_url":"https://api.github.com/repos/rorysaur/quack/contents/{+path}","compare_url":"https://api.github.com/repos/rorysaur/quack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rorysaur/quack/merges","archive_url":"https://api.github.com/repos/rorysaur/quack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rorysaur/quack/downloads","issues_url":"https://api.github.com/repos/rorysaur/quack/issues{/number}","pulls_url":"https://api.github.com/repos/rorysaur/quack/pulls{/number}","milestones_url":"https://api.github.com/repos/rorysaur/quack/milestones{/number}","notifications_url":"https://api.github.com/repos/rorysaur/quack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rorysaur/quack/labels{/name}","releases_url":"https://api.github.com/repos/rorysaur/quack/releases{/id}","created_at":"2015-03-11T05:22:59Z","updated_at":"2015-04-01T04:17:36Z","pushed_at":"2015-04-02T02:28:58Z","git_url":"git://github.com/rorysaur/quack.git","ssh_url":"git@github.com:rorysaur/quack.git","clone_url":"https://github.com/rorysaur/quack.git","svn_url":"https://github.com/rorysaur/quack","homepage":null,"size":928,"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":19,"forks":0,"open_issues":19,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rorysaur/quack/pulls/59"},"html":{"href":"https://github.com/rorysaur/quack/pull/59"},"issue":{"href":"https://api.github.com/repos/rorysaur/quack/issues/59"},"comments":{"href":"https://api.github.com/repos/rorysaur/quack/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/rorysaur/quack/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/rorysaur/quack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rorysaur/quack/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/rorysaur/quack/statuses/7156179908255aaf4059f0babc8c0236eefcc6ec"}}}}