{"action":"created","comment":{"url":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/comments/72081765","id":72081765,"diff_hunk":"@@ -0,0 +1,181 @@\n+import React, { Component } from 'react';\n+import { Link, hashHistory } from 'react-router';\n+import { connect } from 'react-redux';\n+import * as actions from '../actions';\n+import Table from './table';\n+import { queueEvents, webListener, notifications } from '../lib/utils';\n+import _ from 'lodash';\n+\n+class Listings extends Component {\n+  constructor(props) {\n+    super(props);\n+    \n+    this.listener = null; \n+    this.bQueue = [];\n+    this.loop = null;\n+\n+    this.handleMessage = this.handleMessage.bind(this);\n+  }\n+\n+  /** \n+  * Close Listener connection \n+  */\n+  stopListening() {\n+    webListener.stopListening();\n+  }\n+\n+  /** \n+  * Start Listener connection \n+  */\n+  startListening(taskGroupId, onMessageAction) {\n+    webListener.startListening(taskGroupId, onMessageAction);\n+  }\n+\n+  /** \n+  * Handle message from listener \n+  */\n+  handleMessage(message) {\n+    const { taskId } = this.props.params;\n+    \n+    // Handle Error\n+    if (message instanceof Error) { \n+      // Set state to error true\n+      this.props.setDashboardBanner(message);\n+      return;\n+    }\n+\n+    // Find queue exchanges\n+    let queueExchanges = [\n+      queueEvents.taskDefined().exchange,\n+      queueEvents.taskPending().exchange,\n+      queueEvents.taskRunning().exchange,\n+      queueEvents.artifactCreated().exchange,\n+      queueEvents.taskCompleted().exchange,\n+      queueEvents.taskFailed().exchange,\n+      queueEvents.taskException().exchange\n+    ];\n+\n+    // Dispatch to handleQueueMessage or handleSchedulerMessage\n+    if (_.includes(queueExchanges, message.exchange)) {\n+      // Append message to buffer queue\n+      this.bQueue.push(message);\n+\n+      // Update active task if taskId match with message update\n+      if (taskId && taskId === message.payload.status.taskId) {\n+        this.props.fetchTask(taskId);\n+        this.props.fetchStatus(taskId);  \n+      }\n+      \n+      // Handle edge cases that will increase UX\n+      this.handleEdgeCases(message);     \n+    }\n+  }\n+\n+  /**\n+  * Handle special cases\n+  */\n+  handleEdgeCases(message) {\n+    const { fetchTask, fetchStatus, params } = this.props;\n+    const { taskId } = params;\n+\n+    // Give priority to exceptions to show without waiting for loop to happen\n+    if (message.exchange === queueEvents.taskException().exchange) {\n+      notifications.notifyUser(\"Task exception\");\n+    }\n+    if (message.exchange === queueEvents.taskFailed().exchange) {","path":"push-inspector/containers/listings.jsx","position":85,"original_position":85,"commit_id":"46fa85e16f8352ecd2325c3460b44189b2458d9a","original_commit_id":"46fa85e16f8352ecd2325c3460b44189b2458d9a","user":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"body":"Insert line between conditionals.","created_at":"2016-07-25T15:10:57Z","updated_at":"2016-07-25T15:10:57Z","html_url":"https://github.com/taskcluster/taskcluster-tools/pull/118#discussion_r72081765","pull_request_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/comments/72081765"},"html":{"href":"https://github.com/taskcluster/taskcluster-tools/pull/118#discussion_r72081765"},"pull_request":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118","id":76473540,"html_url":"https://github.com/taskcluster/taskcluster-tools/pull/118","diff_url":"https://github.com/taskcluster/taskcluster-tools/pull/118.diff","patch_url":"https://github.com/taskcluster/taskcluster-tools/pull/118.patch","issue_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/issues/118","number":118,"state":"open","locked":false,"title":"Push inspector First PR","user":{"login":"helfi92","id":3766511,"avatar_url":"https://avatars.githubusercontent.com/u/3766511?v=3","gravatar_id":"","url":"https://api.github.com/users/helfi92","html_url":"https://github.com/helfi92","followers_url":"https://api.github.com/users/helfi92/followers","following_url":"https://api.github.com/users/helfi92/following{/other_user}","gists_url":"https://api.github.com/users/helfi92/gists{/gist_id}","starred_url":"https://api.github.com/users/helfi92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helfi92/subscriptions","organizations_url":"https://api.github.com/users/helfi92/orgs","repos_url":"https://api.github.com/users/helfi92/repos","events_url":"https://api.github.com/users/helfi92/events{/privacy}","received_events_url":"https://api.github.com/users/helfi92/received_events","type":"User","site_admin":false},"body":"**New features:**\r\n\r\n- Uses React-Redux\r\n- Uses React-Router { hashHistory }\r\n- Uses Await Async for asynchronous calls\r\n- Filtering by statuses\r\n- Tasks update roughly in real time\r\n- Progress bar to show status for better UX\r\n- Dashboard banner to show descriptive error messages\r\n- Web Push Notifications\r\n\r\n@eliperelman @jonasfj @selenamarie \r\n\r\n\r\n\r\n","created_at":"2016-07-06T17:51:51Z","updated_at":"2016-07-25T15:10:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false},"assignees":[{"login":"eliperelman","id":285899,"avatar_url":"https://avatars.githubusercontent.com/u/285899?v=3","gravatar_id":"","url":"https://api.github.com/users/eliperelman","html_url":"https://github.com/eliperelman","followers_url":"https://api.github.com/users/eliperelman/followers","following_url":"https://api.github.com/users/eliperelman/following{/other_user}","gists_url":"https://api.github.com/users/eliperelman/gists{/gist_id}","starred_url":"https://api.github.com/users/eliperelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eliperelman/subscriptions","organizations_url":"https://api.github.com/users/eliperelman/orgs","repos_url":"https://api.github.com/users/eliperelman/repos","events_url":"https://api.github.com/users/eliperelman/events{/privacy}","received_events_url":"https://api.github.com/users/eliperelman/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118/commits","review_comments_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118/comments","review_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/issues/118/comments","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/statuses/46fa85e16f8352ecd2325c3460b44189b2458d9a","head":{"label":"helfi92:push-inspector","ref":"push-inspector","sha":"46fa85e16f8352ecd2325c3460b44189b2458d9a","user":{"login":"helfi92","id":3766511,"avatar_url":"https://avatars.githubusercontent.com/u/3766511?v=3","gravatar_id":"","url":"https://api.github.com/users/helfi92","html_url":"https://github.com/helfi92","followers_url":"https://api.github.com/users/helfi92/followers","following_url":"https://api.github.com/users/helfi92/following{/other_user}","gists_url":"https://api.github.com/users/helfi92/gists{/gist_id}","starred_url":"https://api.github.com/users/helfi92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helfi92/subscriptions","organizations_url":"https://api.github.com/users/helfi92/orgs","repos_url":"https://api.github.com/users/helfi92/repos","events_url":"https://api.github.com/users/helfi92/events{/privacy}","received_events_url":"https://api.github.com/users/helfi92/received_events","type":"User","site_admin":false},"repo":{"id":61817074,"name":"taskcluster-tools","full_name":"helfi92/taskcluster-tools","owner":{"login":"helfi92","id":3766511,"avatar_url":"https://avatars.githubusercontent.com/u/3766511?v=3","gravatar_id":"","url":"https://api.github.com/users/helfi92","html_url":"https://github.com/helfi92","followers_url":"https://api.github.com/users/helfi92/followers","following_url":"https://api.github.com/users/helfi92/following{/other_user}","gists_url":"https://api.github.com/users/helfi92/gists{/gist_id}","starred_url":"https://api.github.com/users/helfi92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helfi92/subscriptions","organizations_url":"https://api.github.com/users/helfi92/orgs","repos_url":"https://api.github.com/users/helfi92/repos","events_url":"https://api.github.com/users/helfi92/events{/privacy}","received_events_url":"https://api.github.com/users/helfi92/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/helfi92/taskcluster-tools","description":"Tools for debugging, inspecting and managing TaskCluster","fork":true,"url":"https://api.github.com/repos/helfi92/taskcluster-tools","forks_url":"https://api.github.com/repos/helfi92/taskcluster-tools/forks","keys_url":"https://api.github.com/repos/helfi92/taskcluster-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helfi92/taskcluster-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helfi92/taskcluster-tools/teams","hooks_url":"https://api.github.com/repos/helfi92/taskcluster-tools/hooks","issue_events_url":"https://api.github.com/repos/helfi92/taskcluster-tools/issues/events{/number}","events_url":"https://api.github.com/repos/helfi92/taskcluster-tools/events","assignees_url":"https://api.github.com/repos/helfi92/taskcluster-tools/assignees{/user}","branches_url":"https://api.github.com/repos/helfi92/taskcluster-tools/branches{/branch}","tags_url":"https://api.github.com/repos/helfi92/taskcluster-tools/tags","blobs_url":"https://api.github.com/repos/helfi92/taskcluster-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helfi92/taskcluster-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helfi92/taskcluster-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/helfi92/taskcluster-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helfi92/taskcluster-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/helfi92/taskcluster-tools/languages","stargazers_url":"https://api.github.com/repos/helfi92/taskcluster-tools/stargazers","contributors_url":"https://api.github.com/repos/helfi92/taskcluster-tools/contributors","subscribers_url":"https://api.github.com/repos/helfi92/taskcluster-tools/subscribers","subscription_url":"https://api.github.com/repos/helfi92/taskcluster-tools/subscription","commits_url":"https://api.github.com/repos/helfi92/taskcluster-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/helfi92/taskcluster-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/helfi92/taskcluster-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/helfi92/taskcluster-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/helfi92/taskcluster-tools/contents/{+path}","compare_url":"https://api.github.com/repos/helfi92/taskcluster-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helfi92/taskcluster-tools/merges","archive_url":"https://api.github.com/repos/helfi92/taskcluster-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helfi92/taskcluster-tools/downloads","issues_url":"https://api.github.com/repos/helfi92/taskcluster-tools/issues{/number}","pulls_url":"https://api.github.com/repos/helfi92/taskcluster-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/helfi92/taskcluster-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/helfi92/taskcluster-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helfi92/taskcluster-tools/labels{/name}","releases_url":"https://api.github.com/repos/helfi92/taskcluster-tools/releases{/id}","deployments_url":"https://api.github.com/repos/helfi92/taskcluster-tools/deployments","created_at":"2016-06-23T15:42:13Z","updated_at":"2016-06-23T15:42:16Z","pushed_at":"2016-07-21T16:22:44Z","git_url":"git://github.com/helfi92/taskcluster-tools.git","ssh_url":"git@github.com:helfi92/taskcluster-tools.git","clone_url":"https://github.com/helfi92/taskcluster-tools.git","svn_url":"https://github.com/helfi92/taskcluster-tools","homepage":null,"size":2369,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"taskcluster:master","ref":"master","sha":"2fbd7391422bb93bf165298c5094cb5388b7b290","user":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"repo":{"id":25545398,"name":"taskcluster-tools","full_name":"taskcluster/taskcluster-tools","owner":{"login":"taskcluster","id":6257436,"avatar_url":"https://avatars.githubusercontent.com/u/6257436?v=3","gravatar_id":"","url":"https://api.github.com/users/taskcluster","html_url":"https://github.com/taskcluster","followers_url":"https://api.github.com/users/taskcluster/followers","following_url":"https://api.github.com/users/taskcluster/following{/other_user}","gists_url":"https://api.github.com/users/taskcluster/gists{/gist_id}","starred_url":"https://api.github.com/users/taskcluster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskcluster/subscriptions","organizations_url":"https://api.github.com/users/taskcluster/orgs","repos_url":"https://api.github.com/users/taskcluster/repos","events_url":"https://api.github.com/users/taskcluster/events{/privacy}","received_events_url":"https://api.github.com/users/taskcluster/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskcluster/taskcluster-tools","description":"Tools for debugging, inspecting and managing TaskCluster","fork":false,"url":"https://api.github.com/repos/taskcluster/taskcluster-tools","forks_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/forks","keys_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/teams","hooks_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/hooks","issue_events_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/issues/events{/number}","events_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/events","assignees_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/assignees{/user}","branches_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/branches{/branch}","tags_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/tags","blobs_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/languages","stargazers_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/stargazers","contributors_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/contributors","subscribers_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/subscribers","subscription_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/subscription","commits_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/contents/{+path}","compare_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/merges","archive_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/downloads","issues_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/issues{/number}","pulls_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/labels{/name}","releases_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/releases{/id}","deployments_url":"https://api.github.com/repos/taskcluster/taskcluster-tools/deployments","created_at":"2014-10-21T20:51:27Z","updated_at":"2016-03-24T20:46:51Z","pushed_at":"2016-07-23T00:28:10Z","git_url":"git://github.com/taskcluster/taskcluster-tools.git","ssh_url":"git@github.com:taskcluster/taskcluster-tools.git","clone_url":"https://github.com/taskcluster/taskcluster-tools.git","svn_url":"https://github.com/taskcluster/taskcluster-tools","homepage":null,"size":2492,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":10,"forks":32,"open_issues":10,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118"},"html":{"href":"https://github.com/taskcluster/taskcluster-tools/pull/118"},"issue":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/issues/118"},"comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/taskcluster/taskcluster-tools/statuses/46fa85e16f8352ecd2325c3460b44189b2458d9a"}}}}
{"actor":{"display_login":"eliperelman"}}