Workbox v6.1.1 includes a bug fix for the NetworkFirst
strategy, as well as some documentation and TypeScript fixes.
🐛 What's Fixed?
workbox-strategies
The NetworkFirst
strategy uses two promises: one for the network request, and one is the optional networkTimeoutSeconds
option is set. If the network request succeeds, then the timeout promise's timer is canceled. However, the strategy previously attempted to wait until both promises resolve before the handler resolves. This meant that, if the network request succeeds before the timeout, the strategy's over handler promise would not properly resolve.
See #2744
Thanks!
Special thanks to @joshkel for both bringing that NetworkFirst
issue to our attention, as well as contributing the code for the fix!