-
Notifications
You must be signed in to change notification settings - Fork 26.4k
fix(service-worker): do not blow up when caches are unwritable #26042
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
Conversation
You can preview 20e23e2 at https://pr26042-20e23e2.ngbuilds.io/. |
|
||
// Clear the caches and make them unwritable. | ||
await clearAllCaches(scope.caches); | ||
spyOn(MockCache.prototype, 'put').and.throwError('Can\'t touch this'); |
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.
Hammer time?
I'll show myself out
In some cases, example when the user clears the caches in DevTools but the SW remains active on another tab and keeps references to the deleted caches, trying to write to the cache throws errors (e.g. `Entry was not found`). When this happens, the SW can no longer work correctly and should enter a degraded mode allowing requests to be served from the network. Possibly related: - GoogleChrome/workbox#792 - https://bugs.chromium.org/p/chromium/issues/detail?id=639034 This commits remedies this situation, by ensuring the SW can enter the degraded `EXISTING_CLIENTS_ONLY` mode and forward requests to the network.
20e23e2
to
4dff1de
Compare
You can preview 4dff1de at https://pr26042-4dff1de.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.
thanks for fixing this one!
caretaker note: no g3 impact because this code is not synced into g3 |
In some cases, example when the user clears the caches in DevTools but the SW remains active on another tab and keeps references to the deleted caches, trying to write to the cache throws errors (e.g. `Entry was not found`). When this happens, the SW can no longer work correctly and should enter a degraded mode allowing requests to be served from the network. Possibly related: - GoogleChrome/workbox#792 - https://bugs.chromium.org/p/chromium/issues/detail?id=639034 This commits remedies this situation, by ensuring the SW can enter the degraded `EXISTING_CLIENTS_ONLY` mode and forward requests to the network. PR Close #26042
Will this be merged in? It looks closed. |
@patrickmichalina It is in master. See 2bd767c. |
Safari still failing with #26500 with latest version 7.1.0-beta.1 |
@patrickmichalina, can you open a new issue including all necesary details (per the issue template). |
@gkalpak I should have an repo and production deployment that can show the issue. It might just take a week or so. |
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. |
PR Checklist
Docs have been added / updated (for bug fixes / features)PR Type
What is the current behavior?
In some cases, example when the user clears the caches in DevTools but the SW remains active on another tab and keeps references to the deleted caches, trying to write to the cache throws errors (e.g.
Entry was not found
).When this happens, the SW can no longer work correctly and should enter a degraded mode allowing requests to be served from the network.
Possibly related:
What is the new behavior?
In such situations, the SW will enter the degraded
EXISTING_CLIENTS_ONLY
mode and forward requests to the network.Does this PR introduce a breaking change?