[ServiceWorker] Race in Schedule Job algorithm handling of equivalent job promises (#853)

Currently the Schedule Job algorithm says:

> If job is equivalent to lastJob, append job’s promise to lastJob’s list of equivalent job promises.

The intention being to combine repeated jobs (like updates) into a single job where possible.

There is a race, however.  Some jobs resolve their promises before Finish Job is complete.  For example, the Install algorithm calls Resolve Job Promise on step 6, but may call Finish Job much later at step 19.  In between these steps the algorithm waits for the install event to be fired and handled.

If Schedule Job runs between when Resolve Job Promise and Finish Job are invoked, then appending the new promise won't have any effect.  It will never get resolved.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/853

Received on Wednesday, 23 March 2016 20:41:31 UTC