{"action":"created","comment":{"url":"https://api.github.com/repos/inaka/lasse/pulls/comments/65705171","id":65705171,"diff_hunk":"@@ -20,186 +22,182 @@\n           module :: module(),\n           state :: any()\n         }).\n+\n -type state() :: #state{}.\n \n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n %% Behavior definition\n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n \n -type event() ::\n-    #{ id => binary()\n-     , event => binary()\n-     , data => binary()\n-     , retry => binary()\n-     , comment | '' => binary()\n-     }.\n+  #{ id => binary()\n+   , event => binary()\n+   , data => binary()\n+   , retry => binary()\n+   , comment | '' => binary()\n+   }.\n \n -type result() ::\n-    {'send', Event :: event(), NewState :: any()} |\n-    {'nosend', NewState :: any()} |\n-    {'stop', NewState :: any()}.\n+  {'send', Event :: event(), NewState :: any()} |\n+  {'nosend', NewState :: any()} |\n+  {'stop', NewState :: any()}.\n \n -export_type([event/0, result/0]).\n \n--callback init(InitArgs :: any(),\n-               LastEvtId::undefined | binary(),\n+-callback init(InitArgs :: any(), LastEvtId::undefined | binary(),\n                Req::cowboy_req:req()) ->\n-    {ok, NewReq :: cowboy_req:req(), State :: any()} |\n-    {ok, NewReq :: cowboy_req:req(), Events :: [event()], State :: any()} |\n-    {no_content, NewReq :: cowboy_req:req(), State :: any()} |\n-    {\n-      shutdown,\n-      StatusCode :: cowboy:http_status(),\n-      Headers :: cowboy:http_headers(),\n-      Body :: iodata(),\n-      NewReq :: cowboy_req:req(),\n-      State :: any()\n-    }.\n+  {ok, NewReq :: cowboy_req:req(), State :: any()} |\n+  {ok, NewReq :: cowboy_req:req(), Events :: [event()], State :: any()} |\n+  {no_content, NewReq :: cowboy_req:req(), State :: any()} |\n+  {\n+    shutdown,\n+    StatusCode :: cowboy:http_status(),\n+    Headers :: cowboy:http_headers(),\n+    Body :: iodata(),\n+    NewReq :: cowboy_req:req(),\n+    State :: any()\n+  }.\n \n -callback handle_notify(Msg :: any(), State :: any()) ->\n-    result().\n+  result().\n \n -callback handle_info(Msg :: any(), State :: any()) ->\n-    result().\n+  result().\n \n -callback handle_error(Msg :: any(), Reason :: any(), State :: any()) ->\n-    any().\n+  any().\n \n--callback terminate(Reason :: any(),\n-                    Req :: cowboy_req:req(),\n-                    State :: any()) ->\n-    any().\n+-callback terminate(\n+  Reason :: any(), Req :: cowboy_req:req(), State :: any()\n+) -> any().\n \n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n %% Cowboy callbacks\n %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n \n -type lasse_handler_options() ::\n-    module() |\n-    #{ module => module()\n-     , init_args => any()\n-     }.\n-\n--spec init(any(), cowboy_req:req(), lasse_handler_options()) ->\n-    {loop, any(), state()}.\n-init(Transport, Req, []) ->\n-    init(Transport, Req, #{});\n-init(Transport, Req, [Module]) when is_atom(Module) ->\n-    init(Transport, Req, #{module => Module});\n-init(_Transport, Req, Opts) ->\n-    try\n-      #{module := Module} = Opts,\n-      InitArgs = maps:get(init_args, Opts, []),\n-      {LastEventId, Req} = cowboy_req:header(<<\"last-event-id\">>, Req),\n-      InitResult = Module:init(InitArgs, LastEventId, Req),\n-      handle_init(InitResult, Module)\n-    catch\n-      _:{badmatch, #{}} ->\n-        throw(module_option_missing)\n-    end.\n+  module() |\n+  #{ module => module()\n+   , init_args => any()\n+   }.\n+\n+-spec init(cowboy_req:req(), lasse_handler_options()) ->","path":"src/lasse_handler.erl","position":126,"original_position":126,"commit_id":"77aa9c722c3ded15a169a623e2f32aedbaf055c6","original_commit_id":"77aa9c722c3ded15a169a623e2f32aedbaf055c6","user":{"login":"gadgetci","id":10134338,"avatar_url":"https://avatars.githubusercontent.com/u/10134338?v=3","gravatar_id":"","url":"https://api.github.com/users/gadgetci","html_url":"https://github.com/gadgetci","followers_url":"https://api.github.com/users/gadgetci/followers","following_url":"https://api.github.com/users/gadgetci/following{/other_user}","gists_url":"https://api.github.com/users/gadgetci/gists{/gist_id}","starred_url":"https://api.github.com/users/gadgetci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gadgetci/subscriptions","organizations_url":"https://api.github.com/users/gadgetci/orgs","repos_url":"https://api.github.com/users/gadgetci/repos","events_url":"https://api.github.com/users/gadgetci/events{/privacy}","received_events_url":"https://api.github.com/users/gadgetci/received_events","type":"User","site_admin":false},"body":"According to **Dialyzer**:\n>  The return type {atom() | tuple(),_,#state{module:atom() | tuple()}} in the specification of init/2 is not a subtype of {atom() | tuple(),cowboy_req:req(),_} | {atom() | tuple(),cowboy_req:req(),_,'hibernate' | 'infinity' | non_neg_integer()} | {atom() | tuple(),cowboy_req:req(),_,'infinity' | non_neg_integer(),'hibernate'}, which is the expected return type for the callback of cowboy_loop behaviour\n","created_at":"2016-06-03T13:19:09Z","updated_at":"2016-06-03T13:19:09Z","html_url":"https://github.com/inaka/lasse/pull/44#discussion_r65705171","pull_request_url":"https://api.github.com/repos/inaka/lasse/pulls/44","_links":{"self":{"href":"https://api.github.com/repos/inaka/lasse/pulls/comments/65705171"},"html":{"href":"https://github.com/inaka/lasse/pull/44#discussion_r65705171"},"pull_request":{"href":"https://api.github.com/repos/inaka/lasse/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/inaka/lasse/pulls/44","id":72415402,"html_url":"https://github.com/inaka/lasse/pull/44","diff_url":"https://github.com/inaka/lasse/pull/44.diff","patch_url":"https://github.com/inaka/lasse/pull/44.patch","issue_url":"https://api.github.com/repos/inaka/lasse/issues/44","number":44,"state":"open","locked":false,"title":"[Close #42] Euen.42.update to cowboy 2","user":{"login":"Euen","id":1340695,"avatar_url":"https://avatars.githubusercontent.com/u/1340695?v=3","gravatar_id":"","url":"https://api.github.com/users/Euen","html_url":"https://github.com/Euen","followers_url":"https://api.github.com/users/Euen/followers","following_url":"https://api.github.com/users/Euen/following{/other_user}","gists_url":"https://api.github.com/users/Euen/gists{/gist_id}","starred_url":"https://api.github.com/users/Euen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Euen/subscriptions","organizations_url":"https://api.github.com/users/Euen/orgs","repos_url":"https://api.github.com/users/Euen/repos","events_url":"https://api.github.com/users/Euen/events{/privacy}","received_events_url":"https://api.github.com/users/Euen/received_events","type":"User","site_admin":false},"body":"[Close #42] Euen.42.update to cowboy 2","created_at":"2016-06-02T20:51:54Z","updated_at":"2016-06-03T13:19:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73d5375446a05202ce05c547f461d765b17a4a69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/inaka/lasse/pulls/44/commits","review_comments_url":"https://api.github.com/repos/inaka/lasse/pulls/44/comments","review_comment_url":"https://api.github.com/repos/inaka/lasse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inaka/lasse/issues/44/comments","statuses_url":"https://api.github.com/repos/inaka/lasse/statuses/77aa9c722c3ded15a169a623e2f32aedbaf055c6","head":{"label":"inaka:euen.42.update_to_cowboy_2","ref":"euen.42.update_to_cowboy_2","sha":"77aa9c722c3ded15a169a623e2f32aedbaf055c6","user":{"login":"inaka","id":867053,"avatar_url":"https://avatars.githubusercontent.com/u/867053?v=3","gravatar_id":"","url":"https://api.github.com/users/inaka","html_url":"https://github.com/inaka","followers_url":"https://api.github.com/users/inaka/followers","following_url":"https://api.github.com/users/inaka/following{/other_user}","gists_url":"https://api.github.com/users/inaka/gists{/gist_id}","starred_url":"https://api.github.com/users/inaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inaka/subscriptions","organizations_url":"https://api.github.com/users/inaka/orgs","repos_url":"https://api.github.com/users/inaka/repos","events_url":"https://api.github.com/users/inaka/events{/privacy}","received_events_url":"https://api.github.com/users/inaka/received_events","type":"Organization","site_admin":false},"repo":{"id":20452255,"name":"lasse","full_name":"inaka/lasse","owner":{"login":"inaka","id":867053,"avatar_url":"https://avatars.githubusercontent.com/u/867053?v=3","gravatar_id":"","url":"https://api.github.com/users/inaka","html_url":"https://github.com/inaka","followers_url":"https://api.github.com/users/inaka/followers","following_url":"https://api.github.com/users/inaka/following{/other_user}","gists_url":"https://api.github.com/users/inaka/gists{/gist_id}","starred_url":"https://api.github.com/users/inaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inaka/subscriptions","organizations_url":"https://api.github.com/users/inaka/orgs","repos_url":"https://api.github.com/users/inaka/repos","events_url":"https://api.github.com/users/inaka/events{/privacy}","received_events_url":"https://api.github.com/users/inaka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inaka/lasse","description":"SSE handler for Cowboy","fork":false,"url":"https://api.github.com/repos/inaka/lasse","forks_url":"https://api.github.com/repos/inaka/lasse/forks","keys_url":"https://api.github.com/repos/inaka/lasse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inaka/lasse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inaka/lasse/teams","hooks_url":"https://api.github.com/repos/inaka/lasse/hooks","issue_events_url":"https://api.github.com/repos/inaka/lasse/issues/events{/number}","events_url":"https://api.github.com/repos/inaka/lasse/events","assignees_url":"https://api.github.com/repos/inaka/lasse/assignees{/user}","branches_url":"https://api.github.com/repos/inaka/lasse/branches{/branch}","tags_url":"https://api.github.com/repos/inaka/lasse/tags","blobs_url":"https://api.github.com/repos/inaka/lasse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inaka/lasse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inaka/lasse/git/refs{/sha}","trees_url":"https://api.github.com/repos/inaka/lasse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inaka/lasse/statuses/{sha}","languages_url":"https://api.github.com/repos/inaka/lasse/languages","stargazers_url":"https://api.github.com/repos/inaka/lasse/stargazers","contributors_url":"https://api.github.com/repos/inaka/lasse/contributors","subscribers_url":"https://api.github.com/repos/inaka/lasse/subscribers","subscription_url":"https://api.github.com/repos/inaka/lasse/subscription","commits_url":"https://api.github.com/repos/inaka/lasse/commits{/sha}","git_commits_url":"https://api.github.com/repos/inaka/lasse/git/commits{/sha}","comments_url":"https://api.github.com/repos/inaka/lasse/comments{/number}","issue_comment_url":"https://api.github.com/repos/inaka/lasse/issues/comments{/number}","contents_url":"https://api.github.com/repos/inaka/lasse/contents/{+path}","compare_url":"https://api.github.com/repos/inaka/lasse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inaka/lasse/merges","archive_url":"https://api.github.com/repos/inaka/lasse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inaka/lasse/downloads","issues_url":"https://api.github.com/repos/inaka/lasse/issues{/number}","pulls_url":"https://api.github.com/repos/inaka/lasse/pulls{/number}","milestones_url":"https://api.github.com/repos/inaka/lasse/milestones{/number}","notifications_url":"https://api.github.com/repos/inaka/lasse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inaka/lasse/labels{/name}","releases_url":"https://api.github.com/repos/inaka/lasse/releases{/id}","deployments_url":"https://api.github.com/repos/inaka/lasse/deployments","created_at":"2014-06-03T17:24:57Z","updated_at":"2016-05-11T14:11:10Z","pushed_at":"2016-06-03T13:17:32Z","git_url":"git://github.com/inaka/lasse.git","ssh_url":"git@github.com:inaka/lasse.git","clone_url":"https://github.com/inaka/lasse.git","svn_url":"https://github.com/inaka/lasse","homepage":null,"size":198,"stargazers_count":28,"watchers_count":28,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":28,"default_branch":"master"}},"base":{"label":"inaka:cowboy2","ref":"cowboy2","sha":"692eaec1a226a6247f8450fc23b86b8afc1cee7a","user":{"login":"inaka","id":867053,"avatar_url":"https://avatars.githubusercontent.com/u/867053?v=3","gravatar_id":"","url":"https://api.github.com/users/inaka","html_url":"https://github.com/inaka","followers_url":"https://api.github.com/users/inaka/followers","following_url":"https://api.github.com/users/inaka/following{/other_user}","gists_url":"https://api.github.com/users/inaka/gists{/gist_id}","starred_url":"https://api.github.com/users/inaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inaka/subscriptions","organizations_url":"https://api.github.com/users/inaka/orgs","repos_url":"https://api.github.com/users/inaka/repos","events_url":"https://api.github.com/users/inaka/events{/privacy}","received_events_url":"https://api.github.com/users/inaka/received_events","type":"Organization","site_admin":false},"repo":{"id":20452255,"name":"lasse","full_name":"inaka/lasse","owner":{"login":"inaka","id":867053,"avatar_url":"https://avatars.githubusercontent.com/u/867053?v=3","gravatar_id":"","url":"https://api.github.com/users/inaka","html_url":"https://github.com/inaka","followers_url":"https://api.github.com/users/inaka/followers","following_url":"https://api.github.com/users/inaka/following{/other_user}","gists_url":"https://api.github.com/users/inaka/gists{/gist_id}","starred_url":"https://api.github.com/users/inaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inaka/subscriptions","organizations_url":"https://api.github.com/users/inaka/orgs","repos_url":"https://api.github.com/users/inaka/repos","events_url":"https://api.github.com/users/inaka/events{/privacy}","received_events_url":"https://api.github.com/users/inaka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inaka/lasse","description":"SSE handler for Cowboy","fork":false,"url":"https://api.github.com/repos/inaka/lasse","forks_url":"https://api.github.com/repos/inaka/lasse/forks","keys_url":"https://api.github.com/repos/inaka/lasse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inaka/lasse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inaka/lasse/teams","hooks_url":"https://api.github.com/repos/inaka/lasse/hooks","issue_events_url":"https://api.github.com/repos/inaka/lasse/issues/events{/number}","events_url":"https://api.github.com/repos/inaka/lasse/events","assignees_url":"https://api.github.com/repos/inaka/lasse/assignees{/user}","branches_url":"https://api.github.com/repos/inaka/lasse/branches{/branch}","tags_url":"https://api.github.com/repos/inaka/lasse/tags","blobs_url":"https://api.github.com/repos/inaka/lasse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inaka/lasse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inaka/lasse/git/refs{/sha}","trees_url":"https://api.github.com/repos/inaka/lasse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inaka/lasse/statuses/{sha}","languages_url":"https://api.github.com/repos/inaka/lasse/languages","stargazers_url":"https://api.github.com/repos/inaka/lasse/stargazers","contributors_url":"https://api.github.com/repos/inaka/lasse/contributors","subscribers_url":"https://api.github.com/repos/inaka/lasse/subscribers","subscription_url":"https://api.github.com/repos/inaka/lasse/subscription","commits_url":"https://api.github.com/repos/inaka/lasse/commits{/sha}","git_commits_url":"https://api.github.com/repos/inaka/lasse/git/commits{/sha}","comments_url":"https://api.github.com/repos/inaka/lasse/comments{/number}","issue_comment_url":"https://api.github.com/repos/inaka/lasse/issues/comments{/number}","contents_url":"https://api.github.com/repos/inaka/lasse/contents/{+path}","compare_url":"https://api.github.com/repos/inaka/lasse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inaka/lasse/merges","archive_url":"https://api.github.com/repos/inaka/lasse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inaka/lasse/downloads","issues_url":"https://api.github.com/repos/inaka/lasse/issues{/number}","pulls_url":"https://api.github.com/repos/inaka/lasse/pulls{/number}","milestones_url":"https://api.github.com/repos/inaka/lasse/milestones{/number}","notifications_url":"https://api.github.com/repos/inaka/lasse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inaka/lasse/labels{/name}","releases_url":"https://api.github.com/repos/inaka/lasse/releases{/id}","deployments_url":"https://api.github.com/repos/inaka/lasse/deployments","created_at":"2014-06-03T17:24:57Z","updated_at":"2016-05-11T14:11:10Z","pushed_at":"2016-06-03T13:17:32Z","git_url":"git://github.com/inaka/lasse.git","ssh_url":"git@github.com:inaka/lasse.git","clone_url":"https://github.com/inaka/lasse.git","svn_url":"https://github.com/inaka/lasse","homepage":null,"size":198,"stargazers_count":28,"watchers_count":28,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inaka/lasse/pulls/44"},"html":{"href":"https://github.com/inaka/lasse/pull/44"},"issue":{"href":"https://api.github.com/repos/inaka/lasse/issues/44"},"comments":{"href":"https://api.github.com/repos/inaka/lasse/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/inaka/lasse/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/inaka/lasse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inaka/lasse/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/inaka/lasse/statuses/77aa9c722c3ded15a169a623e2f32aedbaf055c6"}}}}
{"actor":{"display_login":"gadgetci"}}