RESOLVED INVALID 182916
Issues with Service Worker on treebo.com
https://bugs.webkit.org/show_bug.cgi?id=182916
Summary Issues with Service Worker on treebo.com
Kenji Baheux
Reported 2018-02-18 20:47:13 PST
Created attachment 334133 [details] Screenshot showing a bad state Filing this on behalf of Jeffrey Posnick Setup: Tech Preview 49. https://www.treebo.com Uses sw-precache [1] for static assets, but not navigations. Issues observed: - Offline-fallback logic works in Chrome, but never appears to be triggered when navigating offline to https://www.treebo.com. [JS] - Once, I was able to get into a state in which the request for the HTML (which isn't served from the cache, but does pass through the SW) was only partially successful. I had to clear out the SW and caches using Safari's Privacy settings to get back into a functional state. [SCREENSHOT] [1]: https://github.com/GoogleChromeLabs/sw-precache [JS]: https://static.treebo.com/rodimus/build/client/offline/offline.00000002.js [SCREENSHOT]: attached
Attachments
Screenshot showing a bad state (1.61 MB, image/png)
2018-02-18 20:47 PST, Kenji Baheux
no flags
Radar WebKit Bug Importer
Comment 1 2018-02-19 08:14:21 PST
Chris Dumez
Comment 2 2018-02-19 09:45:13 PST
Someone needs to explain to me how to trigger the offline logic in Chrome. With the latest Chrome Canary, I tried: 1. Load https://www.treebo.com 2. Wait ~10 seconds 3. Reload https://www.treebo.com 4. Wait ~10 seconds 5. Turn off Wifi on my laptop 6. Reload https://www.treebo.com / Or Go to https://www.treebo.com in a new tab -> I get a generic error about having no internet connection Behavior is similar on both Chrome and Safari Technology Preview 49.
Kenji Baheux
Comment 3 2018-02-22 22:42:09 PST
Treebo is down for me (403)... I'll try again over the weekend and see if Jeffrey is back from vacation.
Jeffrey Posnick
Comment 4 2018-02-26 08:25:46 PST
After looking into it some more, it seems like Treebo has a customized service worker that it uses for "mobile" user agents. That service worker script imports https://static.treebo.com/rodimus/build/client/offline/offline.00000002.js which in turn handles the custom offline page for failed navigations. So, the offline fallback wasn't working in Safari TP 49 when I tested because I was using a "desktop" user agent, and the offline fallback script wasn't imported. I just upgraded to Safari TP 50 and explicitly switched my user agent emulation to iOS 11.0 - iPhone, and I was served the service worker script with the extra offline fallback logic. It works as expected when I disabled my internet connection and navigated to the page. I'm not readily able to reproduce the second issue, as it only cropped up once while testing with TP 49. It might have been due to a bug in Safari TP 49 that has since been fixed in Safari TP 50.
Chris Dumez
Comment 5 2018-02-26 09:02:11 PST
Marking as resolved as per last comment.
Note You need to log in before you can comment on or make changes to this bug.