Hi Bashi,Don't know if this is the right channel to ask for help or report service worker but got your email address from a colleague. Excuse for bothering you otherwise.Here is the summary of issue I am facing with latest Chrome 85 release. I tried to submit a new issue on chromium bug site but no luck, 400 bad response on submit.Issue: Service worker cache.addAll fetch pending, stuck on trying to installStep to reproduce:1.Register a service worker with global scope
navigator.serviceWorker.register('/ServiceWorker.js', { scope: '/', updateViaCache: 'none' }).then(function (registration) {
});
2. Attach install event which looks like
self.addEventListener('install', function(event) {
event.waitUntil(
caches.open(cacheName).then(function(cache) {
return cache.addAll(
[
'/css/bootstrap.css',
'/css/main.css',
'/js/bootstrap.min.js',
'/js/jquery.min.js',
'/offline.html',
'/path/subpath/par1/par2'
'/path/subpath/par1/par3'
'/path/subpath1/par4/par5'
]
);
})
);
});
3. Following request will never complete and install will stuck on trying to install and eventully, in error/redudndant.
'/path/subpath/par1/par2'
'/path/subpath/par1/par3'
'/path/subpath1/par4/par5'
Expeced behaviour:
Just like earlier version chrome 85* should also work until and unless there a reason/security thing* for failure which should be indicated as an error/warning. PWA is running fine since last 2 year and we have not made any changes.
Explanation/Analysis:
Service worker install event never succeed anymore after chrome 85 update on my web application. It works fine on chrome 84 or earlier, Safari, Firefox, Microsoft Edge browser.
Service worker endsup in error (1)/Redundant after trying to install for long time and in console I see many fetch request with pending status/stalled.
However most of those url with pending status has path info and are extension less urls and not static resources.
For example, when install event triggers, it gets an array of url's
https://xyz.com/path/test1.js ==> Fetch completed
https://xyz.com/path/test2.js ==> Fetch completed
https://xyz.com/path/image.jpg ==> Fetch completed
https://xyz.com/path/image2.jpg ==> Fetch completed
https://xyz.com/path/subpath/par1/par2 ==> Fetch completed
and then stalled ones appears, which never completes
https://xyz.com/path/subpath/par3/par4 ==> Fetch pending/stalled
https://xyz.com/path/subpath/par4/par5 ==> Fetch pending/stalled
and then again some completed ones
https://xyz.com/path/test.js ==> Fetch completed
In HAR fetch call, completed and failed request looks like this:
Fetch success:
fetch("https://xyz.com/FG/Index/1/TEST", {
"headers": {
"accept": "*/*",
"accept-language": "en,nl;q=0.9",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"referrer": "https://xyz.com/ServiceWorker",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
});
Pending/Stalled:
fetch("https://xyz.com/FG/Index/2/TEST1", {
"referrer": "https://xyz.com/ServiceWorker",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
In my analysis, all static server resources works fine, *.js, *.css, *.jpg . So if I remove non static links service worker install correctly and all works fine.
Could you please point me right direction, how can I can connect on right channel about this issue. Thanks--Regards,S. Sharma
That throttling is causing in our case request go into stalled state and stuck on trying to install state and eventually ended up with redundant error.
There is no flag available to disable the throttling so I decided to use cache.add instead of cache.addAll with handling all the promises and voila it works. Seems this way max concurrent request are not hit and installation can continue.
Behavior is very likely to happen with large cache and requests that takes a little longer to response.
Thanks,
Sandeep Sharma