Re: [ServiceWorker] should update() during top level script evaluation be ignored? (#800)

> That's right. And even in the example in the OP, update() was called within the installing worker's script, the newest worker, the installing worker itself, is always there. But the Schedule Job will aggregate this update() job in favor of the running installation, so there won't be such an endless set of failing updates.

You will still end up with continuous updates running once every 1 second (or whatever update delay the particular browser uses).  This seems bad to me.  I think we should remove the potential for infinite loops in job scheduling where possible.

I think it would be better to silently resolve the update() promise with success if called:

1) During top level sw script evaluation.
2) Called while install event is being processed.

In both cases we can argue an update is already in progress and its the same kind of short-circuit as Register does in its step 5.3. 

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

Received on Thursday, 14 January 2016 15:39:14 UTC