{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/22878470","id":22878470,"diff_hunk":"@@ -72,7 +72,36 @@\n     }\n   }\n \n+  var hawkCrypto = null;\n+\n+  // Since hawk.crypto and hawk.crypto.getClientHeader are promises now,\n+  // and so we don't have to change the logic, we just check here and\n+  // continue when we have all the data we need.\n   function _request(options, onsuccess, onerror, skipRetry) {\n+    if (options.credentials && options.credentials.type !== 'BrowserID') {\n+      if (hawkCrypto === null) {\n+        window.hawk.crypto.then(hc => {\n+          // Just retry after getting hawkCrypto\n+          hawkCrypto = hc;\n+          _request(options, onsuccess, onerror, skipRetry);\n+        });\n+        return;\n+      }\n+      // At this point we have hawkCrypto, so we can generate the header and pass it","path":"app/js/helpers/client_request_helper.js","position":19,"original_position":19,"commit_id":"c101f008d1c2313b1da79ee71a914165ae25d599","original_commit_id":"c101f008d1c2313b1da79ee71a914165ae25d599","user":{"login":"jaoo","id":690184,"avatar_url":"https://avatars.githubusercontent.com/u/690184?v=3","gravatar_id":"","url":"https://api.github.com/users/jaoo","html_url":"https://github.com/jaoo","followers_url":"https://api.github.com/users/jaoo/followers","following_url":"https://api.github.com/users/jaoo/following{/other_user}","gists_url":"https://api.github.com/users/jaoo/gists{/gist_id}","starred_url":"https://api.github.com/users/jaoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaoo/subscriptions","organizations_url":"https://api.github.com/users/jaoo/orgs","repos_url":"https://api.github.com/users/jaoo/repos","events_url":"https://api.github.com/users/jaoo/events{/privacy}","received_events_url":"https://api.github.com/users/jaoo/received_events","type":"User","site_admin":false},"body":"nit: 80 chars per line.","created_at":"2015-01-13T17:33:56Z","updated_at":"2015-01-13T17:33:56Z","html_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/439#discussion_r22878470","pull_request_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/22878470"},"html":{"href":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/439#discussion_r22878470"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439","id":27202369,"html_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/439","diff_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/439.diff","patch_url":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/439.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/439","number":439,"state":"open","locked":false,"title":"Bug 1113599 - Change hawk.js cryptography to webcrypto if available, SJCL if not","user":{"login":"AntonioMA","id":1955672,"avatar_url":"https://avatars.githubusercontent.com/u/1955672?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonioMA","html_url":"https://github.com/AntonioMA","followers_url":"https://api.github.com/users/AntonioMA/followers","following_url":"https://api.github.com/users/AntonioMA/following{/other_user}","gists_url":"https://api.github.com/users/AntonioMA/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonioMA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonioMA/subscriptions","organizations_url":"https://api.github.com/users/AntonioMA/orgs","repos_url":"https://api.github.com/users/AntonioMA/repos","events_url":"https://api.github.com/users/AntonioMA/events{/privacy}","received_events_url":"https://api.github.com/users/AntonioMA/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-12T15:40:17Z","updated_at":"2015-01-13T17:33:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1906a7441957725df39c45bd8ef9fe4d05184396","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/439/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/statuses/c101f008d1c2313b1da79ee71a914165ae25d599","head":{"label":"AntonioMA:bug1113599-rebased","ref":"bug1113599-rebased","sha":"c101f008d1c2313b1da79ee71a914165ae25d599","user":{"login":"AntonioMA","id":1955672,"avatar_url":"https://avatars.githubusercontent.com/u/1955672?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonioMA","html_url":"https://github.com/AntonioMA","followers_url":"https://api.github.com/users/AntonioMA/followers","following_url":"https://api.github.com/users/AntonioMA/following{/other_user}","gists_url":"https://api.github.com/users/AntonioMA/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonioMA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonioMA/subscriptions","organizations_url":"https://api.github.com/users/AntonioMA/orgs","repos_url":"https://api.github.com/users/AntonioMA/repos","events_url":"https://api.github.com/users/AntonioMA/events{/privacy}","received_events_url":"https://api.github.com/users/AntonioMA/received_events","type":"User","site_admin":false},"repo":{"id":21935536,"name":"firefoxos-loop-client","full_name":"AntonioMA/firefoxos-loop-client","owner":{"login":"AntonioMA","id":1955672,"avatar_url":"https://avatars.githubusercontent.com/u/1955672?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonioMA","html_url":"https://github.com/AntonioMA","followers_url":"https://api.github.com/users/AntonioMA/followers","following_url":"https://api.github.com/users/AntonioMA/following{/other_user}","gists_url":"https://api.github.com/users/AntonioMA/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonioMA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonioMA/subscriptions","organizations_url":"https://api.github.com/users/AntonioMA/orgs","repos_url":"https://api.github.com/users/AntonioMA/repos","events_url":"https://api.github.com/users/AntonioMA/events{/privacy}","received_events_url":"https://api.github.com/users/AntonioMA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AntonioMA/firefoxos-loop-client","description":"Firefox OS client for the Loop service","fork":true,"url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client","forks_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/forks","keys_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/teams","hooks_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/hooks","issue_events_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/issues/events{/number}","events_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/events","assignees_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/assignees{/user}","branches_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/branches{/branch}","tags_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/tags","blobs_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/statuses/{sha}","languages_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/languages","stargazers_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/stargazers","contributors_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/contributors","subscribers_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/subscribers","subscription_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/subscription","commits_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/issues/comments/{number}","contents_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/contents/{+path}","compare_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/merges","archive_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/downloads","issues_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/issues{/number}","pulls_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/pulls{/number}","milestones_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/milestones{/number}","notifications_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/labels{/name}","releases_url":"https://api.github.com/repos/AntonioMA/firefoxos-loop-client/releases{/id}","created_at":"2014-07-17T09:07:55Z","updated_at":"2015-01-12T11:26:40Z","pushed_at":"2015-01-12T15:42:06Z","git_url":"git://github.com/AntonioMA/firefoxos-loop-client.git","ssh_url":"git@github.com:AntonioMA/firefoxos-loop-client.git","clone_url":"https://github.com/AntonioMA/firefoxos-loop-client.git","svn_url":"https://github.com/AntonioMA/firefoxos-loop-client","homepage":null,"size":11168,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mozilla-b2g:master","ref":"master","sha":"51a04dd1f06cba2f2de4f8bfb718e719c2b1361e","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":18225071,"name":"firefoxos-loop-client","full_name":"mozilla-b2g/firefoxos-loop-client","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/firefoxos-loop-client","description":"Firefox OS client for the Loop service","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client","forks_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/releases{/id}","created_at":"2014-03-28T20:10:24Z","updated_at":"2015-01-13T16:39:50Z","pushed_at":"2015-01-13T16:39:50Z","git_url":"git://github.com/mozilla-b2g/firefoxos-loop-client.git","ssh_url":"git@github.com:mozilla-b2g/firefoxos-loop-client.git","clone_url":"https://github.com/mozilla-b2g/firefoxos-loop-client.git","svn_url":"https://github.com/mozilla-b2g/firefoxos-loop-client","homepage":null,"size":14682,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":40,"forks":36,"open_issues":40,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439"},"html":{"href":"https://github.com/mozilla-b2g/firefoxos-loop-client/pull/439"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/439"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/issues/439/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/pulls/439/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/firefoxos-loop-client/statuses/c101f008d1c2313b1da79ee71a914165ae25d599"}}}}