Repository navigation
Conversation
gkalpak
force-pushed
the
fix-sw-failed-version
branch
from
September 20, 2021 17:57
48911b5 to
cb55d21
Compare
|
You can preview cb55d21 at https://pr43518-cb55d21.ngbuilds.io/. |
gkalpak
marked this pull request as ready for review
September 20, 2021 18:37
Previously, a ServiceWorker test was using the `MockServerState#sawRequestFor()` method. This method, however, only returns a boolean indicating whether a request had been seen, but would not throw an error in either case. Since the intention was to assert that a specific request was made, this commit switches to the correct `MockServerState#assertSawRequestFor()` method.
Previously, when a version was found to be broken, any clients assigned to that version were unassigned (and either assigned to the latest version or to none if the latest version was the broken one). A version could be considered broken for several reasons, but most often it is a response for a hashed asset that eiher does not exist or contains different content than the SW expects. See angular#28114 (comment) for more details. However, assigning a client to a different version (or the network) in the middle of a session, turned out to be more risky than keeping it on the same version. For angular.io, for example, it has led to angular#28114. This commit avoids making things worse when identifying a broken version by keeping existing clients to their assigned version (but ensuring that no new clients are assigned to the broken version). NOTE: Reloading the page generates a new client ID, so it is like a new client for the SW, even if the tab and URL are the same.
gkalpak
force-pushed
the
fix-sw-failed-version
branch
from
September 21, 2021 10:19
cb55d21 to
ab5e790
Compare
Contributor
|
Thank you, @gkalpak!!! |
1 of 3 tasks
alxhub
pushed a commit
that referenced
this pull request
Sep 24, 2021
…43518) Previously, when a version was found to be broken, any clients assigned to that version were unassigned (and either assigned to the latest version or to none if the latest version was the broken one). A version could be considered broken for several reasons, but most often it is a response for a hashed asset that eiher does not exist or contains different content than the SW expects. See #28114 (comment) for more details. However, assigning a client to a different version (or the network) in the middle of a session, turned out to be more risky than keeping it on the same version. For angular.io, for example, it has led to #28114. This commit avoids making things worse when identifying a broken version by keeping existing clients to their assigned version (but ensuring that no new clients are assigned to the broken version). NOTE: Reloading the page generates a new client ID, so it is like a new client for the SW, even if the tab and URL are the same. PR Close #43518
alxhub
pushed a commit
that referenced
this pull request
Sep 24, 2021
Previously, a ServiceWorker test was using the `MockServerState#sawRequestFor()` method. This method, however, only returns a boolean indicating whether a request had been seen, but would not throw an error in either case. Since the intention was to assert that a specific request was made, this commit switches to the correct `MockServerState#assertSawRequestFor()` method. PR Close #43518
alxhub
pushed a commit
that referenced
this pull request
Sep 24, 2021
…43518) Previously, when a version was found to be broken, any clients assigned to that version were unassigned (and either assigned to the latest version or to none if the latest version was the broken one). A version could be considered broken for several reasons, but most often it is a response for a hashed asset that eiher does not exist or contains different content than the SW expects. See #28114 (comment) for more details. However, assigning a client to a different version (or the network) in the middle of a session, turned out to be more risky than keeping it on the same version. For angular.io, for example, it has led to #28114. This commit avoids making things worse when identifying a broken version by keeping existing clients to their assigned version (but ensuring that no new clients are assigned to the broken version). NOTE: Reloading the page generates a new client ID, so it is like a new client for the SW, even if the tab and URL are the same. PR Close #43518
This was referenced Oct 1, 2021
Closed
Closed
This was referenced Oct 1, 2021
gkalpak
added a commit
to gkalpak/angular
that referenced
this pull request
Oct 2, 2021
This commit updates angular.io to the latest stable version of the Angular framework (v12.2.8). Among other benefits, this version also includes the ServiceWorker fix from angular#43518, which fixes angular#28114. NOTE: This commit also makes the necessary changes to more closely align angular.io with new apps created with the latest stable Angular CLI. Fixes angular#28114
dylhunn
pushed a commit
that referenced
this pull request
Oct 5, 2021
This commit updates angular.io to the latest stable version of the Angular framework (v12.2.8). Among other benefits, this version also includes the ServiceWorker fix from #43518, which fixes #28114. NOTE: This commit also makes the necessary changes to more closely align angular.io with new apps created with the latest stable Angular CLI. Fixes #28114 PR Close #43687
gkalpak
added a commit
to gkalpak/angular
that referenced
this pull request
Oct 5, 2021
…ion fails When an app version is detected as broken, the SW calls the `Driver#versionFailed()` method. Previously, this method would in turn call the `Driver#sync()` method, which writes some metadata about the SW's state to the `ngsw:/:db:contol` cache. More specifically, `Driver#sync()` persists info about all known app versions, which one is the latest and also what version each client is assigned to. However, no relevant info is changed inside `Driver#versionFailed()`, so the call to `Driver#sync()` is redundant (since there are no changes that need to be synced with the cache). This is a left-over from before angular#43518, when `Driver#versionFailed()` used to update version assignments and thus did require synchronization with the cache. This commit removes the redundant `Driver#sync()` call to avoid an unnecessary write to the cache.
jessicajaniuk
pushed a commit
that referenced
this pull request
Oct 21, 2021
…ion fails (#43680) When an app version is detected as broken, the SW calls the `Driver#versionFailed()` method. Previously, this method would in turn call the `Driver#sync()` method, which writes some metadata about the SW's state to the `ngsw:/:db:contol` cache. More specifically, `Driver#sync()` persists info about all known app versions, which one is the latest and also what version each client is assigned to. However, no relevant info is changed inside `Driver#versionFailed()`, so the call to `Driver#sync()` is redundant (since there are no changes that need to be synced with the cache). This is a left-over from before #43518, when `Driver#versionFailed()` used to update version assignments and thus did require synchronization with the cache. This commit removes the redundant `Driver#sync()` call to avoid an unnecessary write to the cache. PR Close #43680
jessicajaniuk
pushed a commit
that referenced
this pull request
Oct 21, 2021
…ion fails (#43680) When an app version is detected as broken, the SW calls the `Driver#versionFailed()` method. Previously, this method would in turn call the `Driver#sync()` method, which writes some metadata about the SW's state to the `ngsw:/:db:contol` cache. More specifically, `Driver#sync()` persists info about all known app versions, which one is the latest and also what version each client is assigned to. However, no relevant info is changed inside `Driver#versionFailed()`, so the call to `Driver#sync()` is redundant (since there are no changes that need to be synced with the cache). This is a left-over from before #43518, when `Driver#versionFailed()` used to update version assignments and thus did require synchronization with the cache. This commit removes the redundant `Driver#sync()` call to avoid an unnecessary write to the cache. PR Close #43680
jessicajaniuk
pushed a commit
that referenced
this pull request
Oct 21, 2021
…ion fails (#43680) When an app version is detected as broken, the SW calls the `Driver#versionFailed()` method. Previously, this method would in turn call the `Driver#sync()` method, which writes some metadata about the SW's state to the `ngsw:/:db:contol` cache. More specifically, `Driver#sync()` persists info about all known app versions, which one is the latest and also what version each client is assigned to. However, no relevant info is changed inside `Driver#versionFailed()`, so the call to `Driver#sync()` is redundant (since there are no changes that need to be synced with the cache). This is a left-over from before #43518, when `Driver#versionFailed()` used to update version assignments and thus did require synchronization with the cache. This commit removes the redundant `Driver#sync()` call to avoid an unnecessary write to the cache. PR Close #43680
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, when a version was found to be broken, any clients assigned to that version were unassigned (and either assigned to the latest version or to none if the latest version was the broken one). A version could be considered broken for several reasons, but most often it is a response for a hashed asset that eiher does not exist or contains different content than the SW expects. See #28114 (comment) for more details.
However, assigning a client to a different version (or the network) in the middle of a session, turned out to be more risky than keeping it on the same version. For angular.io, for example, it has led to #28114.
This commit avoids making things worse when identifying a broken version by keeping existing clients to their assigned version (but ensuring that no new clients are assigned to the broken version).
NOTE:
Reloading the page generates a new client ID, so it is like a new client for the SW, even if the tab and URL are the same.