[w3c/ServiceWorker] Should add “script type” and “update via cache” when check two jobs are equivalent. (#1358)

In the current spec, we enqueue a new job to _jobQueue_ if it is not equivalent to the last job of a  _jobQueue_. Spec says ( [Schedule Job 6.](https://w3c.github.io/ServiceWorker/#schedule-job-algorithm) ):
> 1. Let lastJob be the element at the back of jobQueue.
> 2 .If job is **equivalent** to lastJob and lastJob’s job promise has not settled, append job to lastJob’s list of equivalent jobs.
> 3. Else, set job’s containing job queue to jobQueue, and enqueue job to jobQueue.

Also **equivalent** means in the spec ( [dfn-job-equivalent](https://w3c.github.io/ServiceWorker/#dfn-job-equivalent) ):
> Two jobs are equivalent when their job type is the same and:
>  - **For register and update jobs, both their scope url and the script url are the same.**
>  - For unregister jobs, their scope url is the same.

I think script type and update via cache should also be the same for equivalent register and update jobs. Because we might ignore a new job which has different script type/update via cache if we do not add this check. 


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

Received on Thursday, 4 October 2018 05:46:14 UTC