New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(service-worker): correctly handle failed cache-busted request #39786
Conversation
You can preview d834d24 at https://pr39786-d834d24.ngbuilds.io/. |
if (networkResult.ok) { | ||
let response = await this.safeFetch(req); | ||
|
||
// Decide whether a cache-busted request is necessary. A cache-busted request is necessary iff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Decide whether a cache-busted request is necessary. A cache-busted request is necessary iff | |
// Decide whether a cache-busted request is necessary. A cache-busted request is necessary if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this was intended, but I'll change it since it might confuse some people 😅
Thx for taking a look ✨
d834d24
to
31f8591
Compare
You can preview 31f8591 at https://pr39786-31f8591.ngbuilds.io/. |
Since 5be4edf, a failing cache-busted network request (such as requests for fetching uncached assets) will cause the ServiceWorker to incorrectly enter a degraded `EXISTING_CLIENTS_ONLY` mode. A failing network request could be caused by many reasons, including the client or server being offline, and does not necessarily signify a broken ServiceWorker state. This commit fixes the logic in `cacheBustedFetchFromNetwork()` to correctly handle errors in network requests. For more details on the problem and the implemented fix see angular#39775. Fixes angular#39775
31f8591
to
febee11
Compare
You can preview febee11 at https://pr39786-febee11.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…9786) Since 5be4edf, a failing cache-busted network request (such as requests for fetching uncached assets) will cause the ServiceWorker to incorrectly enter a degraded `EXISTING_CLIENTS_ONLY` mode. A failing network request could be caused by many reasons, including the client or server being offline, and does not necessarily signify a broken ServiceWorker state. This commit fixes the logic in `cacheBustedFetchFromNetwork()` to correctly handle errors in network requests. For more details on the problem and the implemented fix see #39775. Fixes #39775 PR Close #39786
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Since 5be4edf, a failing cache-busted network request (such as requests for fetching an uncached asset) will cause the ServiceWorker to incorrectly enter a degraded
EXISTING_CLIENTS_ONLY
mode. A failing network request could be caused by many reasons, including the client or server being offline, and does not necessarily signify a broken ServiceWorker state.This commit fixes the logic in
cacheBustedFetchFromNetwork()
to correctly handle errors in network requests.For more details on the problem and the implemented fix see #39775.
Fixes #39775.