Skip to content
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

Old version not changing to new version without hard refresh while dev window is open. #1603

Closed
pirovorster opened this issue Aug 11, 2018 · 8 comments

Comments

@pirovorster
Copy link

I have posted the following question on Stackoverflow with a bounty (until it expired), with no responses

https://stackoverflow.com/questions/51583964/workbox-old-version-not-changing-to-new-version

I am using workbox to cache my single page application. My webpack settings looks as follows:

new workboxPlugin({
	globDirectory: dist,
	globPatterns: ['**/*.js', '**/*.html'],
	swDest: path.join(dist, 'sw.js'),
	clientsClaim: true,
	skipWaiting: true,	
	}),

For the most part it works. However sometimes some devices refuse to update. (I don't know if it effects all browsers but specifically Chrome: Version 67.0.3396.99 is effected)
One scenario:

  1. I refresh the page a few times with ctrl - F5. But the new version does not appear
  2. I open chrome development tools and do a ctrl - F5. Then it works
  3. If I press normal F5 (with or without devtools open) it reverts to the previous version of the application. In addition, if I close the dev tools and press ctrl - F5 it also reverts.

Other devices upgrade flawlessly.

@jeffposnick jeffposnick added Needs More Info Waiting on additional information from the community. workbox-webpack-plugin workbox-precaching labels Aug 13, 2018
@jeffposnick
Copy link
Contributor

What you describe makes me wonder whether one of a few things is happening:

  • There's something going on with your web server's HTTP Cache-Control headers that's causing assets to be added to the browser cache, and Workbox believes that the requests for those assets do not need to be cache-busted.

  • You're on a device that is almost out of free storage, and your attempts to update previously cached entries are failing due to QuotaExceeded errors.

Could you pass along a few pieces of additional information if you're able to reproduce the issue?

  1. A screenshot or an .har archive of the relevant HTTP traffic reported in the Network panel of Chrome DevTools.

  2. A copy of any errors that might be logged in the JS console.

  3. The contents of your generated precache manifest file, ideally both the before (pre-update) and after (post-update).

@pirovorster
Copy link
Author

Thanks for the help.

I will post the required info when the issue happens again. Unfortunately it does not always happen. Will try to reproduce it asap.

@pirovorster
Copy link
Author

I have not been able to reproduce the issue. Apologies for the delay. Will let you know as soon as it happens again.

@jeffposnick jeffposnick added Chillin' Not being actively worked on, or deferred for a point in the future. and removed Needs More Info Waiting on additional information from the community. labels Aug 21, 2018
@pirovorster
Copy link
Author

Ok the following happened to me again today

I refreshed and refreshed and could not get the new version to display. Then opened the dev tools and refreshed again and only then did it work.

Also note that my quota is fine. I have an indicator on my site: 15326 MB of 15330 MB available.

I will keep posting if it happens again.

@jeffposnick jeffposnick removed the Chillin' Not being actively worked on, or deferred for a point in the future. label Sep 17, 2018
@jeffposnick
Copy link
Contributor

Thanks for providing those details.

The .har archive shows that your new service worker file was downloaded, but it doesn't include the network requests for the precached assets. Did you see any errors logged in the JS console at the time?

Also, I noticed that you're using Workbox 2.1.3. We're now up to Workbox 3.6.1, and while I'm not aware of any specific bugs that were fixed in between the two releases that would explain what you're seeing, I'd recommend upgrading anyway—it will make it easier to debug this if you're on the latest codebase.

@pirovorster
Copy link
Author

Hi @jeffposnick

Thanks for the help.

Happened again today. There are no JS console errors. Except for the upgrade is there anything else I can provide you that might help debugging.

@pirovorster
Copy link
Author

I have upgraded to the latest version. Will post here if I have any further issues.

@jeffposnick
Copy link
Contributor

Closing due to lack of activity—if the original poster is still able to reproduce with the latest Workbox release, we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants