GitHub PullRequestReviewCommentEvent at 2014-12-11 18:09:04
Repository: shed
Actor: jeffposnick
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/wibblymat/shed/pulls/comments/21695125","id":21695125,"diff_hunk":"@@ -0,0 +1,185 @@\n+'use strict';\n+\n+require('serviceworker-cache-polyfill/lib/caches');\n+var router = require('./router');\n+\n+var version = 1;\n+var cachePrefix = 'shed-' + self.scope + '-';\n+var cacheName = cachePrefix + version;\n+var preCacheItems = [];\n+\n+// Internal Helpers\n+\n+function openCache() {\n+  return caches.open(cacheName);\n+}\n+\n+function networkFetch(request) {\n+  return fetch(request);\n+}\n+\n+function cacheFetch(request) {\n+  return openCache().then(function(cache) {\n+    return cache.match(request);\n+  });\n+}\n+\n+function fetchAndCache(request) {\n+  return networkFetch(request.clone()).then(function(response) {\n+    openCache().then(function(cache) {","path":"lib/shed.js","position":29,"original_position":29,"commit_id":"006fcf297d1f482ef9a1cfc471f15b92f801349f","original_commit_id":"006fcf297d1f482ef9a1cfc471f15b92f801349f","user":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars.githubusercontent.com/u/1749548?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"body":"`fetch()` only rejects if the network request fails entirely. It may resolve with a `response` that represents an HTTP error, which you _probably_ don't want to cache.\r\n\r\nAssuming you want to take errors into account, I'm not sure whether it would make more sense here to return a `Promise` that rejects, or just to not cache. I guess it depends on how the `Promise` returned by `fetchAndCache` is being used downstream.","created_at":"2014-12-11T18:09:04Z","updated_at":"2014-12-11T18:09:04Z","html_url":"https://github.com/wibblymat/shed/pull/1#discussion_r21695125","pull_request_url":"https://api.github.com/repos/wibblymat/shed/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/wibblymat/shed/pulls/comments/21695125"},"html":{"href":"https://github.com/wibblymat/shed/pull/1#discussion_r21695125"},"pull_request":{"href":"https://api.github.com/repos/wibblymat/shed/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/wibblymat/shed/pulls/1","id":25906313,"html_url":"https://github.com/wibblymat/shed/pull/1","diff_url":"https://github.com/wibblymat/shed/pull/1.diff","patch_url":"https://github.com/wibblymat/shed/pull/1.patch","issue_url":"https://api.github.com/repos/wibblymat/shed/issues/1","number":1,"state":"open","locked":false,"title":"Initial import","user":{"login":"wibblymat","id":393358,"avatar_url":"https://avatars.githubusercontent.com/u/393358?v=3","gravatar_id":"","url":"https://api.github.com/users/wibblymat","html_url":"https://github.com/wibblymat","followers_url":"https://api.github.com/users/wibblymat/followers","following_url":"https://api.github.com/users/wibblymat/following{/other_user}","gists_url":"https://api.github.com/users/wibblymat/gists{/gist_id}","starred_url":"https://api.github.com/users/wibblymat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wibblymat/subscriptions","organizations_url":"https://api.github.com/users/wibblymat/orgs","repos_url":"https://api.github.com/users/wibblymat/repos","events_url":"https://api.github.com/users/wibblymat/events{/privacy}","received_events_url":"https://api.github.com/users/wibblymat/received_events","type":"User","site_admin":false},"body":"This is my first push of code to GitHub, made as a pull request for easier review","created_at":"2014-12-11T15:12:44Z","updated_at":"2014-12-11T18:09:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b84bfc96ad88ee7939008de80f8da1a2a927588","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wibblymat/shed/pulls/1/commits","review_comments_url":"https://api.github.com/repos/wibblymat/shed/pulls/1/comments","review_comment_url":"https://api.github.com/repos/wibblymat/shed/pulls/comments/{number}","comments_url":"https://api.github.com/repos/wibblymat/shed/issues/1/comments","statuses_url":"https://api.github.com/repos/wibblymat/shed/statuses/006fcf297d1f482ef9a1cfc471f15b92f801349f","head":{"label":"wibblymat:initial","ref":"initial","sha":"006fcf297d1f482ef9a1cfc471f15b92f801349f","user":{"login":"wibblymat","id":393358,"avatar_url":"https://avatars.githubusercontent.com/u/393358?v=3","gravatar_id":"","url":"https://api.github.com/users/wibblymat","html_url":"https://github.com/wibblymat","followers_url":"https://api.github.com/users/wibblymat/followers","following_url":"https://api.github.com/users/wibblymat/following{/other_user}","gists_url":"https://api.github.com/users/wibblymat/gists{/gist_id}","starred_url":"https://api.github.com/users/wibblymat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wibblymat/subscriptions","organizations_url":"https://api.github.com/users/wibblymat/orgs","repos_url":"https://api.github.com/users/wibblymat/repos","events_url":"https://api.github.com/users/wibblymat/events{/privacy}","received_events_url":"https://api.github.com/users/wibblymat/received_events","type":"User","site_admin":false},"repo":{"id":27876939,"name":"shed","full_name":"wibblymat/shed","owner":{"login":"wibblymat","id":393358,"avatar_url":"https://avatars.githubusercontent.com/u/393358?v=3","gravatar_id":"","url":"https://api.github.com/users/wibblymat","html_url":"https://github.com/wibblymat","followers_url":"https://api.github.com/users/wibblymat/followers","following_url":"https://api.github.com/users/wibblymat/following{/other_user}","gists_url":"https://api.github.com/users/wibblymat/gists{/gist_id}","starred_url":"https://api.github.com/users/wibblymat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wibblymat/subscriptions","organizations_url":"https://api.github.com/users/wibblymat/orgs","repos_url":"https://api.github.com/users/wibblymat/repos","events_url":"https://api.github.com/users/wibblymat/events{/privacy}","received_events_url":"https://api.github.com/users/wibblymat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wibblymat/shed","description":"","fork":false,"url":"https://api.github.com/repos/wibblymat/shed","forks_url":"https://api.github.com/repos/wibblymat/shed/forks","keys_url":"https://api.github.com/repos/wibblymat/shed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wibblymat/shed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wibblymat/shed/teams","hooks_url":"https://api.github.com/repos/wibblymat/shed/hooks","issue_events_url":"https://api.github.com/repos/wibblymat/shed/issues/events{/number}","events_url":"https://api.github.com/repos/wibblymat/shed/events","assignees_url":"https://api.github.com/repos/wibblymat/shed/assignees{/user}","branches_url":"https://api.github.com/repos/wibblymat/shed/branches{/branch}","tags_url":"https://api.github.com/repos/wibblymat/shed/tags","blobs_url":"https://api.github.com/repos/wibblymat/shed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wibblymat/shed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wibblymat/shed/git/refs{/sha}","trees_url":"https://api.github.com/repos/wibblymat/shed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wibblymat/shed/statuses/{sha}","languages_url":"https://api.github.com/repos/wibblymat/shed/languages","stargazers_url":"https://api.github.com/repos/wibblymat/shed/stargazers","contributors_url":"https://api.github.com/repos/wibblymat/shed/contributors","subscribers_url":"https://api.github.com/repos/wibblymat/shed/subscribers","subscription_url":"https://api.github.com/repos/wibblymat/shed/subscription","commits_url":"https://api.github.com/repos/wibblymat/shed/commits{/sha}","git_commits_url":"https://api.github.com/repos/wibblymat/shed/git/commits{/sha}","comments_url":"https://api.github.com/repos/wibblymat/shed/comments{/number}","issue_comment_url":"https://api.github.com/repos/wibblymat/shed/issues/comments/{number}","contents_url":"https://api.github.com/repos/wibblymat/shed/contents/{+path}","compare_url":"https://api.github.com/repos/wibblymat/shed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wibblymat/shed/merges","archive_url":"https://api.github.com/repos/wibblymat/shed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wibblymat/shed/downloads","issues_url":"https://api.github.com/repos/wibblymat/shed/issues{/number}","pulls_url":"https://api.github.com/repos/wibblymat/shed/pulls{/number}","milestones_url":"https://api.github.com/repos/wibblymat/shed/milestones{/number}","notifications_url":"https://api.github.com/repos/wibblymat/shed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wibblymat/shed/labels{/name}","releases_url":"https://api.github.com/repos/wibblymat/shed/releases{/id}","created_at":"2014-12-11T15:07:20Z","updated_at":"2014-12-11T15:07:20Z","pushed_at":"2014-12-11T16:40:10Z","git_url":"git://github.com/wibblymat/shed.git","ssh_url":"git@github.com:wibblymat/shed.git","clone_url":"https://github.com/wibblymat/shed.git","svn_url":"https://github.com/wibblymat/shed","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"wibblymat:master","ref":"master","sha":"4efedb126c60066c13e60790308357658fc672d6","user":{"login":"wibblymat","id":393358,"avatar_url":"https://avatars.githubusercontent.com/u/393358?v=3","gravatar_id":"","url":"https://api.github.com/users/wibblymat","html_url":"https://github.com/wibblymat","followers_url":"https://api.github.com/users/wibblymat/followers","following_url":"https://api.github.com/users/wibblymat/following{/other_user}","gists_url":"https://api.github.com/users/wibblymat/gists{/gist_id}","starred_url":"https://api.github.com/users/wibblymat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wibblymat/subscriptions","organizations_url":"https://api.github.com/users/wibblymat/orgs","repos_url":"https://api.github.com/users/wibblymat/repos","events_url":"https://api.github.com/users/wibblymat/events{/privacy}","received_events_url":"https://api.github.com/users/wibblymat/received_events","type":"User","site_admin":false},"repo":{"id":27876939,"name":"shed","full_name":"wibblymat/shed","owner":{"login":"wibblymat","id":393358,"avatar_url":"https://avatars.githubusercontent.com/u/393358?v=3","gravatar_id":"","url":"https://api.github.com/users/wibblymat","html_url":"https://github.com/wibblymat","followers_url":"https://api.github.com/users/wibblymat/followers","following_url":"https://api.github.com/users/wibblymat/following{/other_user}","gists_url":"https://api.github.com/users/wibblymat/gists{/gist_id}","starred_url":"https://api.github.com/users/wibblymat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wibblymat/subscriptions","organizations_url":"https://api.github.com/users/wibblymat/orgs","repos_url":"https://api.github.com/users/wibblymat/repos","events_url":"https://api.github.com/users/wibblymat/events{/privacy}","received_events_url":"https://api.github.com/users/wibblymat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wibblymat/shed","description":"","fork":false,"url":"https://api.github.com/repos/wibblymat/shed","forks_url":"https://api.github.com/repos/wibblymat/shed/forks","keys_url":"https://api.github.com/repos/wibblymat/shed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wibblymat/shed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wibblymat/shed/teams","hooks_url":"https://api.github.com/repos/wibblymat/shed/hooks","issue_events_url":"https://api.github.com/repos/wibblymat/shed/issues/events{/number}","events_url":"https://api.github.com/repos/wibblymat/shed/events","assignees_url":"https://api.github.com/repos/wibblymat/shed/assignees{/user}","branches_url":"https://api.github.com/repos/wibblymat/shed/branches{/branch}","tags_url":"https://api.github.com/repos/wibblymat/shed/tags","blobs_url":"https://api.github.com/repos/wibblymat/shed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wibblymat/shed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wibblymat/shed/git/refs{/sha}","trees_url":"https://api.github.com/repos/wibblymat/shed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wibblymat/shed/statuses/{sha}","languages_url":"https://api.github.com/repos/wibblymat/shed/languages","stargazers_url":"https://api.github.com/repos/wibblymat/shed/stargazers","contributors_url":"https://api.github.com/repos/wibblymat/shed/contributors","subscribers_url":"https://api.github.com/repos/wibblymat/shed/subscribers","subscription_url":"https://api.github.com/repos/wibblymat/shed/subscription","commits_url":"https://api.github.com/repos/wibblymat/shed/commits{/sha}","git_commits_url":"https://api.github.com/repos/wibblymat/shed/git/commits{/sha}","comments_url":"https://api.github.com/repos/wibblymat/shed/comments{/number}","issue_comment_url":"https://api.github.com/repos/wibblymat/shed/issues/comments/{number}","contents_url":"https://api.github.com/repos/wibblymat/shed/contents/{+path}","compare_url":"https://api.github.com/repos/wibblymat/shed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wibblymat/shed/merges","archive_url":"https://api.github.com/repos/wibblymat/shed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wibblymat/shed/downloads","issues_url":"https://api.github.com/repos/wibblymat/shed/issues{/number}","pulls_url":"https://api.github.com/repos/wibblymat/shed/pulls{/number}","milestones_url":"https://api.github.com/repos/wibblymat/shed/milestones{/number}","notifications_url":"https://api.github.com/repos/wibblymat/shed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wibblymat/shed/labels{/name}","releases_url":"https://api.github.com/repos/wibblymat/shed/releases{/id}","created_at":"2014-12-11T15:07:20Z","updated_at":"2014-12-11T15:07:20Z","pushed_at":"2014-12-11T16:40:10Z","git_url":"git://github.com/wibblymat/shed.git","ssh_url":"git@github.com:wibblymat/shed.git","clone_url":"https://github.com/wibblymat/shed.git","svn_url":"https://github.com/wibblymat/shed","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wibblymat/shed/pulls/1"},"html":{"href":"https://github.com/wibblymat/shed/pull/1"},"issue":{"href":"https://api.github.com/repos/wibblymat/shed/issues/1"},"comments":{"href":"https://api.github.com/repos/wibblymat/shed/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/wibblymat/shed/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/wibblymat/shed/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/wibblymat/shed/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/wibblymat/shed/statuses/006fcf297d1f482ef9a1cfc471f15b92f801349f"}}}}