{"action":"created","comment":{"url":"https://api.github.com/repos/cantino/huginn/pulls/comments/62750527","id":62750527,"diff_hunk":"@@ -42,26 +46,81 @@ def working?\n \n     def receive(incoming_events)\n       incoming_events.sort_by(&:created_at).each do |event|\n-        memory['newest_event_created_at'] ||= 0\n-\n         if !interpolated['value_path'].present? || Utils.value_at(event.payload, interpolated['value_path']).present?\n-          if event.created_at.to_i > memory['newest_event_created_at']\n-            memory['newest_event_created_at'] = event.created_at.to_i\n-            memory.delete('alerted_at')\n+          if stream_path\n+            @stream = Utils.value_at(event.payload, stream_path)\n+            next unless @stream\n+          end\n+          if event.created_at.to_i > newest_event_created_at\n+            self.newest_event_created_at = event.created_at.to_i\n+            clear_alerted_at\n           end\n         end\n       end\n     end\n \n     def check\n       window = interpolated['window_duration_in_days'].to_f.days.ago","path":"app/models/agents/gap_detector_agent.rb","position":34,"original_position":34,"commit_id":"37d18358d197a86213f1d0ed4a1371b54eb86703","original_commit_id":"37d18358d197a86213f1d0ed4a1371b54eb86703","user":{"login":"nestegg","id":6655,"avatar_url":"https://avatars.githubusercontent.com/u/6655?v=3","gravatar_id":"","url":"https://api.github.com/users/nestegg","html_url":"https://github.com/nestegg","followers_url":"https://api.github.com/users/nestegg/followers","following_url":"https://api.github.com/users/nestegg/following{/other_user}","gists_url":"https://api.github.com/users/nestegg/gists{/gist_id}","starred_url":"https://api.github.com/users/nestegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nestegg/subscriptions","organizations_url":"https://api.github.com/users/nestegg/orgs","repos_url":"https://api.github.com/users/nestegg/repos","events_url":"https://api.github.com/users/nestegg/events{/privacy}","received_events_url":"https://api.github.com/users/nestegg/received_events","type":"User","site_admin":false},"body":"Sorry, I don't understand.","created_at":"2016-05-10T20:55:48Z","updated_at":"2016-05-10T20:55:48Z","html_url":"https://github.com/cantino/huginn/pull/1477#discussion_r62750527","pull_request_url":"https://api.github.com/repos/cantino/huginn/pulls/1477","_links":{"self":{"href":"https://api.github.com/repos/cantino/huginn/pulls/comments/62750527"},"html":{"href":"https://github.com/cantino/huginn/pull/1477#discussion_r62750527"},"pull_request":{"href":"https://api.github.com/repos/cantino/huginn/pulls/1477"}}},"pull_request":{"url":"https://api.github.com/repos/cantino/huginn/pulls/1477","id":68916021,"html_url":"https://github.com/cantino/huginn/pull/1477","diff_url":"https://github.com/cantino/huginn/pull/1477.diff","patch_url":"https://github.com/cantino/huginn/pull/1477.patch","issue_url":"https://api.github.com/repos/cantino/huginn/issues/1477","number":1477,"state":"open","locked":false,"title":"Add multi stream support to gap detector","user":{"login":"nestegg","id":6655,"avatar_url":"https://avatars.githubusercontent.com/u/6655?v=3","gravatar_id":"","url":"https://api.github.com/users/nestegg","html_url":"https://github.com/nestegg","followers_url":"https://api.github.com/users/nestegg/followers","following_url":"https://api.github.com/users/nestegg/following{/other_user}","gists_url":"https://api.github.com/users/nestegg/gists{/gist_id}","starred_url":"https://api.github.com/users/nestegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nestegg/subscriptions","organizations_url":"https://api.github.com/users/nestegg/orgs","repos_url":"https://api.github.com/users/nestegg/repos","events_url":"https://api.github.com/users/nestegg/events{/privacy}","received_events_url":"https://api.github.com/users/nestegg/received_events","type":"User","site_admin":false},"body":"Add the ability of the gap detector to monitor multiple streams based on a parameter in the event payload.","created_at":"2016-05-04T19:14:56Z","updated_at":"2016-05-10T20:55:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe511ebc97eaf9abdccc8eb1e61a297359576f8e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cantino/huginn/pulls/1477/commits","review_comments_url":"https://api.github.com/repos/cantino/huginn/pulls/1477/comments","review_comment_url":"https://api.github.com/repos/cantino/huginn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cantino/huginn/issues/1477/comments","statuses_url":"https://api.github.com/repos/cantino/huginn/statuses/37d18358d197a86213f1d0ed4a1371b54eb86703","head":{"label":"nestegg:multistream_gap_detector","ref":"multistream_gap_detector","sha":"37d18358d197a86213f1d0ed4a1371b54eb86703","user":{"login":"nestegg","id":6655,"avatar_url":"https://avatars.githubusercontent.com/u/6655?v=3","gravatar_id":"","url":"https://api.github.com/users/nestegg","html_url":"https://github.com/nestegg","followers_url":"https://api.github.com/users/nestegg/followers","following_url":"https://api.github.com/users/nestegg/following{/other_user}","gists_url":"https://api.github.com/users/nestegg/gists{/gist_id}","starred_url":"https://api.github.com/users/nestegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nestegg/subscriptions","organizations_url":"https://api.github.com/users/nestegg/orgs","repos_url":"https://api.github.com/users/nestegg/repos","events_url":"https://api.github.com/users/nestegg/events{/privacy}","received_events_url":"https://api.github.com/users/nestegg/received_events","type":"User","site_admin":false},"repo":{"id":56534861,"name":"huginn","full_name":"nestegg/huginn","owner":{"login":"nestegg","id":6655,"avatar_url":"https://avatars.githubusercontent.com/u/6655?v=3","gravatar_id":"","url":"https://api.github.com/users/nestegg","html_url":"https://github.com/nestegg","followers_url":"https://api.github.com/users/nestegg/followers","following_url":"https://api.github.com/users/nestegg/following{/other_user}","gists_url":"https://api.github.com/users/nestegg/gists{/gist_id}","starred_url":"https://api.github.com/users/nestegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nestegg/subscriptions","organizations_url":"https://api.github.com/users/nestegg/orgs","repos_url":"https://api.github.com/users/nestegg/repos","events_url":"https://api.github.com/users/nestegg/events{/privacy}","received_events_url":"https://api.github.com/users/nestegg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nestegg/huginn","description":"Build agents that monitor and act on your behalf.  Your agents are standing by!","fork":true,"url":"https://api.github.com/repos/nestegg/huginn","forks_url":"https://api.github.com/repos/nestegg/huginn/forks","keys_url":"https://api.github.com/repos/nestegg/huginn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nestegg/huginn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nestegg/huginn/teams","hooks_url":"https://api.github.com/repos/nestegg/huginn/hooks","issue_events_url":"https://api.github.com/repos/nestegg/huginn/issues/events{/number}","events_url":"https://api.github.com/repos/nestegg/huginn/events","assignees_url":"https://api.github.com/repos/nestegg/huginn/assignees{/user}","branches_url":"https://api.github.com/repos/nestegg/huginn/branches{/branch}","tags_url":"https://api.github.com/repos/nestegg/huginn/tags","blobs_url":"https://api.github.com/repos/nestegg/huginn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nestegg/huginn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nestegg/huginn/git/refs{/sha}","trees_url":"https://api.github.com/repos/nestegg/huginn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nestegg/huginn/statuses/{sha}","languages_url":"https://api.github.com/repos/nestegg/huginn/languages","stargazers_url":"https://api.github.com/repos/nestegg/huginn/stargazers","contributors_url":"https://api.github.com/repos/nestegg/huginn/contributors","subscribers_url":"https://api.github.com/repos/nestegg/huginn/subscribers","subscription_url":"https://api.github.com/repos/nestegg/huginn/subscription","commits_url":"https://api.github.com/repos/nestegg/huginn/commits{/sha}","git_commits_url":"https://api.github.com/repos/nestegg/huginn/git/commits{/sha}","comments_url":"https://api.github.com/repos/nestegg/huginn/comments{/number}","issue_comment_url":"https://api.github.com/repos/nestegg/huginn/issues/comments{/number}","contents_url":"https://api.github.com/repos/nestegg/huginn/contents/{+path}","compare_url":"https://api.github.com/repos/nestegg/huginn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nestegg/huginn/merges","archive_url":"https://api.github.com/repos/nestegg/huginn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nestegg/huginn/downloads","issues_url":"https://api.github.com/repos/nestegg/huginn/issues{/number}","pulls_url":"https://api.github.com/repos/nestegg/huginn/pulls{/number}","milestones_url":"https://api.github.com/repos/nestegg/huginn/milestones{/number}","notifications_url":"https://api.github.com/repos/nestegg/huginn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nestegg/huginn/labels{/name}","releases_url":"https://api.github.com/repos/nestegg/huginn/releases{/id}","deployments_url":"https://api.github.com/repos/nestegg/huginn/deployments","created_at":"2016-04-18T19:13:44Z","updated_at":"2016-04-18T19:13:46Z","pushed_at":"2016-05-04T19:10:39Z","git_url":"git://github.com/nestegg/huginn.git","ssh_url":"git@github.com:nestegg/huginn.git","clone_url":"https://github.com/nestegg/huginn.git","svn_url":"https://github.com/nestegg/huginn","homepage":null,"size":6526,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"cantino:master","ref":"master","sha":"50aff67a8a9773d2c5da62d8baec9e14430d3bef","user":{"login":"cantino","id":83835,"avatar_url":"https://avatars.githubusercontent.com/u/83835?v=3","gravatar_id":"","url":"https://api.github.com/users/cantino","html_url":"https://github.com/cantino","followers_url":"https://api.github.com/users/cantino/followers","following_url":"https://api.github.com/users/cantino/following{/other_user}","gists_url":"https://api.github.com/users/cantino/gists{/gist_id}","starred_url":"https://api.github.com/users/cantino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cantino/subscriptions","organizations_url":"https://api.github.com/users/cantino/orgs","repos_url":"https://api.github.com/users/cantino/repos","events_url":"https://api.github.com/users/cantino/events{/privacy}","received_events_url":"https://api.github.com/users/cantino/received_events","type":"User","site_admin":false},"repo":{"id":8681349,"name":"huginn","full_name":"cantino/huginn","owner":{"login":"cantino","id":83835,"avatar_url":"https://avatars.githubusercontent.com/u/83835?v=3","gravatar_id":"","url":"https://api.github.com/users/cantino","html_url":"https://github.com/cantino","followers_url":"https://api.github.com/users/cantino/followers","following_url":"https://api.github.com/users/cantino/following{/other_user}","gists_url":"https://api.github.com/users/cantino/gists{/gist_id}","starred_url":"https://api.github.com/users/cantino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cantino/subscriptions","organizations_url":"https://api.github.com/users/cantino/orgs","repos_url":"https://api.github.com/users/cantino/repos","events_url":"https://api.github.com/users/cantino/events{/privacy}","received_events_url":"https://api.github.com/users/cantino/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cantino/huginn","description":"Build agents that monitor and act on your behalf.  Your agents are standing by!","fork":false,"url":"https://api.github.com/repos/cantino/huginn","forks_url":"https://api.github.com/repos/cantino/huginn/forks","keys_url":"https://api.github.com/repos/cantino/huginn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cantino/huginn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cantino/huginn/teams","hooks_url":"https://api.github.com/repos/cantino/huginn/hooks","issue_events_url":"https://api.github.com/repos/cantino/huginn/issues/events{/number}","events_url":"https://api.github.com/repos/cantino/huginn/events","assignees_url":"https://api.github.com/repos/cantino/huginn/assignees{/user}","branches_url":"https://api.github.com/repos/cantino/huginn/branches{/branch}","tags_url":"https://api.github.com/repos/cantino/huginn/tags","blobs_url":"https://api.github.com/repos/cantino/huginn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cantino/huginn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cantino/huginn/git/refs{/sha}","trees_url":"https://api.github.com/repos/cantino/huginn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cantino/huginn/statuses/{sha}","languages_url":"https://api.github.com/repos/cantino/huginn/languages","stargazers_url":"https://api.github.com/repos/cantino/huginn/stargazers","contributors_url":"https://api.github.com/repos/cantino/huginn/contributors","subscribers_url":"https://api.github.com/repos/cantino/huginn/subscribers","subscription_url":"https://api.github.com/repos/cantino/huginn/subscription","commits_url":"https://api.github.com/repos/cantino/huginn/commits{/sha}","git_commits_url":"https://api.github.com/repos/cantino/huginn/git/commits{/sha}","comments_url":"https://api.github.com/repos/cantino/huginn/comments{/number}","issue_comment_url":"https://api.github.com/repos/cantino/huginn/issues/comments{/number}","contents_url":"https://api.github.com/repos/cantino/huginn/contents/{+path}","compare_url":"https://api.github.com/repos/cantino/huginn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cantino/huginn/merges","archive_url":"https://api.github.com/repos/cantino/huginn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cantino/huginn/downloads","issues_url":"https://api.github.com/repos/cantino/huginn/issues{/number}","pulls_url":"https://api.github.com/repos/cantino/huginn/pulls{/number}","milestones_url":"https://api.github.com/repos/cantino/huginn/milestones{/number}","notifications_url":"https://api.github.com/repos/cantino/huginn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cantino/huginn/labels{/name}","releases_url":"https://api.github.com/repos/cantino/huginn/releases{/id}","deployments_url":"https://api.github.com/repos/cantino/huginn/deployments","created_at":"2013-03-10T06:00:31Z","updated_at":"2016-05-10T20:41:07Z","pushed_at":"2016-05-10T20:52:32Z","git_url":"git://github.com/cantino/huginn.git","ssh_url":"git@github.com:cantino/huginn.git","clone_url":"https://github.com/cantino/huginn.git","svn_url":"https://github.com/cantino/huginn","homepage":null,"size":8991,"stargazers_count":13944,"watchers_count":13944,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1467,"mirror_url":null,"open_issues_count":193,"forks":1467,"open_issues":193,"watchers":13944,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cantino/huginn/pulls/1477"},"html":{"href":"https://github.com/cantino/huginn/pull/1477"},"issue":{"href":"https://api.github.com/repos/cantino/huginn/issues/1477"},"comments":{"href":"https://api.github.com/repos/cantino/huginn/issues/1477/comments"},"review_comments":{"href":"https://api.github.com/repos/cantino/huginn/pulls/1477/comments"},"review_comment":{"href":"https://api.github.com/repos/cantino/huginn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cantino/huginn/pulls/1477/commits"},"statuses":{"href":"https://api.github.com/repos/cantino/huginn/statuses/37d18358d197a86213f1d0ed4a1371b54eb86703"}}}}