-
Notifications
You must be signed in to change notification settings - Fork 26.5k
fix(service-worker): add UNRECOVERABLE_STATE
handler
#36847
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): add UNRECOVERABLE_STATE
handler
#36847
Conversation
1d2fa37
to
6f833e7
Compare
RESOURCE_REMOVED
handler
a9d8a4b
to
9d1f214
Compare
0396e7a
to
fd1ab83
Compare
RESOURCE_REMOVED
handler UNRECOVERABLE_STATE
handler
fd1ab83
to
9843c4f
Compare
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.
I like where this is heading, but I suggest that we use terminology different from unrecovered
because it gets awkward and confusing to use it. How about using defunkt
, terminalError
, or something of that sort?
@IgorMinar, I was the one that proposed "unrecoverable"/"unrecoverableState" (I assume "unrecovered" is a typo). I find "unrecoverable" more descriptive than "defunkt" or "terminalError" (but not a hill I'm going to die on 😁). |
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.
Thx, @sonukapoor! I've suggested some changes. LMK what you think.
Note to self: We need to document this in the appropriate guides (with code examples).
@gkalpak Please review again. I have made some of the suggested changes. I will address unit tests once we are OK with the changes. |
db24ed5
to
680010b
Compare
01a67a7
to
ab76f91
Compare
You can preview ab76f91 at https://pr36847-ab76f91.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.
Reviewed-for: public-api
In several occasions it has been observed when the browser has evicted eagerly cached assets from the cache and which can also not be found on the server anymore. This can lead to broken state where only parts of the application will load and others will fail. This commit fixes this issue by checking for the missing asset in the cache and on the server. If this condition is true, the broken client will be notified about the current state through the `UnrecoverableStateError`. Closes #36539 PR Close #36847
…gular#36847) This commit adds a helper method to remove individual cached items. PR Close angular#36847
angular#36847) Previously, the condition to make the cache busted was executing although the network request was successful. However, this is not valid. The cache should only be marked as busted when the request failed. This commit fixes the invalid condition. PR Close angular#36847
In several occasions it has been observed when the browser has evicted eagerly cached assets from the cache and which can also not be found on the server anymore. This can lead to broken state where only parts of the application will load and others will fail. This commit fixes this issue by checking for the missing asset in the cache and on the server. If this condition is true, the broken client will be notified about the current state through the `UnrecoverableStateError`. Closes angular#36539 PR Close angular#36847
How can I get this fix? |
@govi2010, this feature was introduced in v11.0.0-next.0. The first stable version that will have it is 11.0.0. |
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
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #36539
What is the new behavior?
Does this PR introduce a breaking change?
Other information