{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleChrome/sw-toolbox/issues/84","labels_url":"https://api.github.com/repos/GoogleChrome/sw-toolbox/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/GoogleChrome/sw-toolbox/issues/84/comments","events_url":"https://api.github.com/repos/GoogleChrome/sw-toolbox/issues/84/events","html_url":"https://github.com/GoogleChrome/sw-toolbox/pull/84","id":127759232,"number":84,"title":"Reject networkFirst when there's a network failure + cache miss","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},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-20T18:59:55Z","updated_at":"2016-01-25T14:53:45Z","closed_at":"2016-01-25T14:22:13Z","pull_request":{"url":"https://api.github.com/repos/GoogleChrome/sw-toolbox/pulls/84","html_url":"https://github.com/GoogleChrome/sw-toolbox/pull/84","diff_url":"https://github.com/GoogleChrome/sw-toolbox/pull/84.diff","patch_url":"https://github.com/GoogleChrome/sw-toolbox/pull/84.patch"},"body":"R: @gauntface @wibblymat @addyosmani \r\n\r\nThis closes #80 by ensuring that `networkFirst` rejects when the following conditions are met:\r\n- There's no previously cached entry to return.\r\n- The initial network request rejected (as opposed to resolved with an error `Response`).\r\n\r\nPrior to this PR, `networkFirst` would resolve with `undefined` when those conditions were met. This PR bring the `networkFirst` behavior in line with the default `fetch()` behavior.\r\n\r\nI'm very much tempted to add a test case for this scenario, but I don't know how to properly force a `NetworkError` in response to a `fetch()`. Maybe once there's some precedent for mocking in our tests that could be revisited."},"comment":{"url":"https://api.github.com/repos/GoogleChrome/sw-toolbox/issues/comments/174530548","html_url":"https://github.com/GoogleChrome/sw-toolbox/pull/84#issuecomment-174530548","issue_url":"https://api.github.com/repos/GoogleChrome/sw-toolbox/issues/84","id":174530548,"user":{"login":"AaronLayton","id":694964,"avatar_url":"https://avatars.githubusercontent.com/u/694964?v=3","gravatar_id":"","url":"https://api.github.com/users/AaronLayton","html_url":"https://github.com/AaronLayton","followers_url":"https://api.github.com/users/AaronLayton/followers","following_url":"https://api.github.com/users/AaronLayton/following{/other_user}","gists_url":"https://api.github.com/users/AaronLayton/gists{/gist_id}","starred_url":"https://api.github.com/users/AaronLayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AaronLayton/subscriptions","organizations_url":"https://api.github.com/users/AaronLayton/orgs","repos_url":"https://api.github.com/users/AaronLayton/repos","events_url":"https://api.github.com/users/AaronLayton/events{/privacy}","received_events_url":"https://api.github.com/users/AaronLayton/received_events","type":"User","site_admin":false},"created_at":"2016-01-25T14:53:45Z","updated_at":"2016-01-25T14:53:45Z","body":"If I update in Bower will I get this update now?"}}