{"action":"created","comment":{"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments/203000704","pull_request_review_id":137803025,"id":203000704,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzAwMDcwNA==","diff_hunk":"@@ -283,19 +308,17 @@ async function updateExistingProfileFromPayload(\n \n   const maybeProfile = errorOrMaybeProfile.value;\n \n-  if (isNone(maybeProfile)) {\n-    // this should never happen since if the profile doesn't exist this function\n-    // will never be called, but let's deal with this anyway, you never know\n-    return ResponseErrorInternal(\n-      \"Error while updating the existing profile, the profile does not exist!\"\n-    );\n-  }\n-\n-  const profile = maybeProfile.value;\n-\n-  const publicExtendedProfile = toExtendedProfile(profile);\n-\n-  return ResponseSuccessJson(publicExtendedProfile);\n+  return maybeProfile.foldL<\n+    IResponseErrorInternal | IResponseSuccessJson<ExtendedProfile>\n+  >(\n+    () =>\n+      // this should never happen since if the profile doesn't exist this function\n+      // will never be called, but let's deal with this anyway, you never know","path":"lib/controllers/profiles.ts","position":100,"original_position":100,"commit_id":"7b522f858d2031d8b13677519615012a8b28c707","original_commit_id":"7b522f858d2031d8b13677519615012a8b28c707","user":{"login":"cloudify","id":48206,"node_id":"MDQ6VXNlcjQ4MjA2","avatar_url":"https://avatars2.githubusercontent.com/u/48206?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudify","html_url":"https://github.com/cloudify","followers_url":"https://api.github.com/users/cloudify/followers","following_url":"https://api.github.com/users/cloudify/following{/other_user}","gists_url":"https://api.github.com/users/cloudify/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify/subscriptions","organizations_url":"https://api.github.com/users/cloudify/orgs","repos_url":"https://api.github.com/users/cloudify/repos","events_url":"https://api.github.com/users/cloudify/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify/received_events","type":"User","site_admin":false},"body":"even though it may be a remote chance of this happening here too","created_at":"2018-07-17T12:28:45Z","updated_at":"2018-07-17T12:31:45Z","html_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/301#discussion_r203000704","pull_request_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments/203000704"},"html":{"href":"https://github.com/teamdigitale/digital-citizenship-functions/pull/301#discussion_r203000704"},"pull_request":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301"}},"in_reply_to_id":202999943},"pull_request":{"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301","id":199951585,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5OTUxNTg1","html_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/301","diff_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/301.diff","patch_url":"https://github.com/teamdigitale/digital-citizenship-functions/pull/301.patch","issue_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/301","number":301,"state":"open","locked":false,"title":"[#157244655] send welcome message","user":{"login":"gunzip","id":148224,"node_id":"MDQ6VXNlcjE0ODIyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/148224?v=4","gravatar_id":"","url":"https://api.github.com/users/gunzip","html_url":"https://github.com/gunzip","followers_url":"https://api.github.com/users/gunzip/followers","following_url":"https://api.github.com/users/gunzip/following{/other_user}","gists_url":"https://api.github.com/users/gunzip/gists{/gist_id}","starred_url":"https://api.github.com/users/gunzip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunzip/subscriptions","organizations_url":"https://api.github.com/users/gunzip/orgs","repos_url":"https://api.github.com/users/gunzip/repos","events_url":"https://api.github.com/users/gunzip/events{/privacy}","received_events_url":"https://api.github.com/users/gunzip/received_events","type":"User","site_admin":false},"body":"Reacts to messages sent to the ProfileEvents queue with one catch-all handler.\r\n\r\nCalls the API (`submitMessageForUser`) through an HTTP request using the API-Key of the service associated to the app backend to send the welcome message.\r\n\r\nI'd like to implement [1] using `request` method from italia-ts-commons bus in order to do that I miss the ability to add custom HTTP headers as RequestHeadersKeys are actually hardcoded.\r\n\r\nWIP as it lacks tests.\r\n","created_at":"2018-07-08T17:15:39Z","updated_at":"2018-07-17T12:31:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5a602cf7c2206d063078fc8142bbbdc0e71c8bd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301/commits","review_comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301/comments","review_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/301/comments","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/7b522f858d2031d8b13677519615012a8b28c707","head":{"label":"teamdigitale:157244655-welcome-message","ref":"157244655-welcome-message","sha":"7b522f858d2031d8b13677519615012a8b28c707","user":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":98789853,"node_id":"MDEwOlJlcG9zaXRvcnk5ODc4OTg1Mw==","name":"digital-citizenship-functions","full_name":"teamdigitale/digital-citizenship-functions","owner":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamdigitale/digital-citizenship-functions","description":"Digital Citizenship APIs","fork":false,"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions","forks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/forks","keys_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/teams","hooks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/events","assignees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/tags","blobs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscription","commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/merges","archive_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/downloads","issues_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/deployments","created_at":"2017-07-30T10:19:53Z","updated_at":"2018-07-17T07:32:06Z","pushed_at":"2018-07-17T12:09:55Z","git_url":"git://github.com/teamdigitale/digital-citizenship-functions.git","ssh_url":"git@github.com:teamdigitale/digital-citizenship-functions.git","clone_url":"https://github.com/teamdigitale/digital-citizenship-functions.git","svn_url":"https://github.com/teamdigitale/digital-citizenship-functions","homepage":"","size":12970,"stargazers_count":4,"watchers_count":4,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6,"open_issues":15,"watchers":4,"default_branch":"master"}},"base":{"label":"teamdigitale:master","ref":"master","sha":"90c600060ec62decf0f1ee38475d93dae96f8505","user":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"repo":{"id":98789853,"node_id":"MDEwOlJlcG9zaXRvcnk5ODc4OTg1Mw==","name":"digital-citizenship-functions","full_name":"teamdigitale/digital-citizenship-functions","owner":{"login":"teamdigitale","id":25081492,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDgxNDky","avatar_url":"https://avatars0.githubusercontent.com/u/25081492?v=4","gravatar_id":"","url":"https://api.github.com/users/teamdigitale","html_url":"https://github.com/teamdigitale","followers_url":"https://api.github.com/users/teamdigitale/followers","following_url":"https://api.github.com/users/teamdigitale/following{/other_user}","gists_url":"https://api.github.com/users/teamdigitale/gists{/gist_id}","starred_url":"https://api.github.com/users/teamdigitale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teamdigitale/subscriptions","organizations_url":"https://api.github.com/users/teamdigitale/orgs","repos_url":"https://api.github.com/users/teamdigitale/repos","events_url":"https://api.github.com/users/teamdigitale/events{/privacy}","received_events_url":"https://api.github.com/users/teamdigitale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/teamdigitale/digital-citizenship-functions","description":"Digital Citizenship APIs","fork":false,"url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions","forks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/forks","keys_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/teams","hooks_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/hooks","issue_events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/events{/number}","events_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/events","assignees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/assignees{/user}","branches_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/branches{/branch}","tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/tags","blobs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/refs{/sha}","trees_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/{sha}","languages_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/languages","stargazers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/stargazers","contributors_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contributors","subscribers_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscribers","subscription_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/subscription","commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/commits{/sha}","git_commits_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/git/commits{/sha}","comments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/comments{/number}","issue_comment_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/comments{/number}","contents_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/contents/{+path}","compare_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/merges","archive_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/downloads","issues_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues{/number}","pulls_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls{/number}","milestones_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/milestones{/number}","notifications_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/labels{/name}","releases_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/releases{/id}","deployments_url":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/deployments","created_at":"2017-07-30T10:19:53Z","updated_at":"2018-07-17T07:32:06Z","pushed_at":"2018-07-17T12:09:55Z","git_url":"git://github.com/teamdigitale/digital-citizenship-functions.git","ssh_url":"git@github.com:teamdigitale/digital-citizenship-functions.git","clone_url":"https://github.com/teamdigitale/digital-citizenship-functions.git","svn_url":"https://github.com/teamdigitale/digital-citizenship-functions","homepage":"","size":12970,"stargazers_count":4,"watchers_count":4,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6,"open_issues":15,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301"},"html":{"href":"https://github.com/teamdigitale/digital-citizenship-functions/pull/301"},"issue":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/301"},"comments":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/issues/301/comments"},"review_comments":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301/comments"},"review_comment":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/pulls/301/commits"},"statuses":{"href":"https://api.github.com/repos/teamdigitale/digital-citizenship-functions/statuses/7b522f858d2031d8b13677519615012a8b28c707"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"cloudify"}}