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

website-service-worker.js breaks after redirecting. #302

Open
foolip opened this issue Mar 12, 2020 · 3 comments
Open

website-service-worker.js breaks after redirecting. #302

foolip opened this issue Mar 12, 2020 · 3 comments

Comments

@foolip
Copy link
Member

foolip commented Mar 12, 2020

After #301 + whatwg/misc-server#126 , https://whatwg.org/mailing-list shows this error in Chrome for me:

This site can’t be reached
The webpage at https://whatwg.org/mailing-list might be temporarily down or it may have moved permanently to a new web address.

It works in incognito. The console (and @annevk) reveals that it's something broken with our SW setup:

website-service-worker.js:47 Could not refresh the cache for https://whatwg.org/mailing-list Error: https://whatwg.org/mailing-list is responding with 0
    at refreshCacheFromNetworkResponse (website-service-worker.js:58)
    at website-service-worker.js:45

What happened is that originally https://whatwg.org/mailing-list was a regular document and now it redirects to https://lists.whatwg.org/.

@foolip
Copy link
Member Author

foolip commented Mar 12, 2020

@domenic
Copy link
Member

domenic commented Mar 12, 2020

It appears redirects trigger neither of the guards in

if (res.type !== "opaque" && !res.ok) {
return Promise.reject(new Error(`${res.url} is responding with ${res.status}`));
}
. It looks like we should check for opaqueredirect as well. Maybe error too? https://fetch.spec.whatwg.org/#concept-response-type

However, that line which is giving the warning is just a warning saying that it can't refresh the cache. It's not the proximate cause of this issue, at least. So I'm still not sure whether this is the service worker's fault, or the HTTP cache.

@annevk
Copy link
Member

annevk commented Mar 12, 2020

Yeah, FWIW, in Firefox I end up at the cached version of https://whatwg.org/mailing-list and no errors.

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

No branches or pull requests

3 participants