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.
With current version multiple clients get auto updated once the service worker receives the first update: with logic included on PR #394
With current changes, it is working properly, also tested on Firefox.
There are a few combinations using
isUpdate
andisExternal
: these 2 flags fromworkbox-window
are defined asboolean | undefined
, wheninstalled|activated
events fired,undefined
values have special meaning.As an example, with only one client:
isExternal: false
with noisUpdate
isExternal: false
andisUpdate: true
andshowSkipWaitingPrompt
being called fromwaiting
event.Problems comes when we have a few clients, for example, 2 tabs in first browser instance and another browser instance:
On first visit we receive
isExternal: false
with noisUpdate
only in the first one client visiting the app, other clients will not receive the eventOn update it is more complex, since we can have a few combinations, here the tests I've made with previous setup (building between tests):
Test 1:
Reloading app in tab1:
isExternal: false
andisUpdate: true
isExternal: false
with noisUpdate
isExternal: false
with noisUpdate
Click prompt reload button from tab1, all clients being updated, then build again.
Test 2:
Reloading browser instance 2:
isExternal: false
andisUpdate: true
isExternal: false
andisUpdate: true
isExternal: false
andisUpdate: true
Click prompt reload button from browser instance 2, all clients being updated, then build again.
Test 3:
Reloading browser instance 2:
isExternal: false
with noisUpdate
isExternal: false
with noisUpdate
isExternal: false
andisUpdate: true
Click prompt reload button from tab2 in browser instance 1, all clients being updated.
It seems on next update
isExternal
depends on the client that fires previous update.