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

Update to sw-precache ^5.0.0 for Chrome 59 and latest Firefox support #1275

Closed
Splaktar opened this issue May 5, 2017 · 8 comments
Closed

Comments

@Splaktar
Copy link

Splaktar commented May 5, 2017

Description

GoogleChromeLabs/sw-precache#241 includes an important fix for Chrome M59 which is expected to break a lot of apps using old versions of sw-precache in June 2017. Firefox has already disabled this redirect behavior which may cause issues for apps using the existing sw-precache from polymer-build and polymer-cli.

Versions & Environment

  • polymer-build: v0.13.0 and v0.17.0
  • node: 6.10.2
  • Operating System: OS X El Capitan

Steps to Reproduce

  1. Follow the steps listed here: https://www.polymer-project.org/1.0/toolbox/service-worker
  2. The load your site with Chrome Version 58.0.3029.96 (64-bit) or similar.
  3. Press the reload button

Expected Results

The page reloads nearly instantly w/o no errors in the console related to sw-precache.

Actual Results

In Chrome 59, the navigation to "https://devfestflorida.org/" will result in a network error, because FetchEvent.respondWith() was called with a redirected response. See https://crbug.com/658249. The url list of the response was: ["https://devfestflorida.org/index.html?sw-precache=d29f0089363aaf48cd80c928c9628029", "https://devfestflorida.org/?sw-precache=d29f0089363aaf48cd80c928c9628029"]

[Deprecation] The service worker responded to the navigation request with a redirected response. This will result in an error in M59, around June 2017.

We noticed this as part of DevFestFlorida/DevFestFloridaSite#36 and the GDG-X Hoverboard project has actually moved to a custom Polymer build (gdg-x/hoverboard#235) instead of using polymer-cli so that they can load the latest (gdg-x/hoverboard@d75b2d3) sw-precache ^5.0.0.

@davinkevin
Copy link
Contributor

davinkevin commented May 8, 2017

We already have the problem on Firefox, soon in Chrome => GoogleChromeLabs/sw-precache#220

The Google Developer Group template is based on this and we are facing this problem 😢

@ozasadnyy
Copy link

Most of DevFest websites stopped working on Firefox and for folks that use Chrome Dev version

@FredKSchott
Copy link
Contributor

Thanks for bringing this to our attention everyone, I hadn't heard about this at all. It seems like this version should be marked deprecated if it will be broken in Firefox and Chrome soon.

I can get to this tomorrow/Wednesday, but would be happy to review a PR if someone wants to tackle the upgrade sooner. I know I looked into updating versions a few months ago, and iirc there were some breaking changes we have to handle.

davinkevin referenced this issue in davinkevin/polymer-build May 8, 2017
davinkevin referenced this issue in davinkevin/polymer-build May 8, 2017
davinkevin referenced this issue in davinkevin/polymer-build May 8, 2017
@jeffposnick
Copy link
Contributor

I know I looked into updating versions a few months ago, and iirc there were some breaking changes we have to handle.

The release notes do a decent job of outlining what's different in each sw-precache release.

The biggest impact of moving from sw-precache 4.x to 5.x is to cause any existing clients that previously had cached content to redownload the entirety of their precache payload. This ensures that the newly cached content has its redirection mode properly scrubbed, resolving the issue mentioned upthread. The major version bump was chosen to reflect the impact of invalidating all the previously precached content.

While there are other, smaller changes that have been made and are outlined in the notes, that's the largest one.

@davinkevin
Copy link
Contributor

@FredKSchott I've proposed a PR (#201) and all the tests seems to be ok on my env, I'm waiting Travis and AppVeyor now 😉

@FredKSchott
Copy link
Contributor

@jeffposnick that's great, I must have been thinking of something else then. Thanks for the info 👍

@jeffposnick
Copy link
Contributor

npm WARN deprecated [email protected]: Please update to v5 or higher to resolve an issue with redirected navigation responses. See https://github.com/GoogleChrome/sw-precache/issues/220

@Splaktar Splaktar changed the title Update to sw-precache ^5.0.0 for Chrome 59 support Update to sw-precache ^5.0.0 for Chrome 59 and latest Firefox support May 8, 2017
davinkevin referenced this issue in davinkevin/polymer-build May 8, 2017
davinkevin referenced this issue in davinkevin/polymer-build May 8, 2017
davinkevin referenced this issue in davinkevin/polymer-build May 8, 2017
davinkevin referenced this issue in davinkevin/polymer-build May 8, 2017
@FredKSchott
Copy link
Contributor

Merged in #201, hopefully released soon along with an upcoming analyzer update.

Thanks for your help everyone! 🤘

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

6 participants