[ServiceWorker] should update on navigation or the subsequent updatefound event be delayed until document DOM is loaded? (#788)

Recently we got a bug report for the following demo:

  https://adriftwith.me/sandbox/service_worker_reload/go.html

When you refresh in chrome you always get the "new ServiceWorker installed" text.  Usually it seems after some delay.

In firefox, however, you usually don't get the text, but sometimes you do.

I believe this is happening because we trigger the update immediately after the fetch event resolves.  This means the update can complete before the document script has a change to attach to the registration objects.  So it never sees the updatefound events.

I agree with the developers that it would be nice to reliably get updatefound events if you are updating on navigation.

Should the spec be changed to delay navigation updates or the navigation updatefound event until the target document has completed loading?

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/788

Received on Saturday, 21 November 2015 03:34:54 UTC