Reject networkFirst when there's a network failure + cache miss #84
Conversation
There are tests along those lines in the branch the original tests were On Wed, 20 Jan 2016, 18:59 Jeffrey Posnick notifications@github.com wrote:
|
The updated behaviour LGTM. Requires rebase. |
I held off LGTMing this for ages because of the old "is it really an exception case?" dilemma. But 5 days is long enough to convince me that I don't have a strong enough opinion to challenge it. LGTM! |
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
fb439f5
to
7b78dc1
Compare
CLAs look good, thanks! |
Reject networkFirst when there's a network failure + cache miss
If I update in Bower will I get this update now? |
@AaronLayton, feel free to pull in @wibblymat, I think the fact that the Fetch API treats this type of failure as an exception means that it's a little more clear-cut as to what |
R: @gauntface @wibblymat @addyosmani
This closes #80 by ensuring that
networkFirst
rejects when the following conditions are met:Response
).Prior to this PR,
networkFirst
would resolve withundefined
when those conditions were met. This PR bring thenetworkFirst
behavior in line with the defaultfetch()
behavior.I'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 afetch()
. Maybe once there's some precedent for mocking in our tests that could be revisited.