[Webkit-unassigned] [Bug 243410] REGRESSION(250037 at main): wpt /service-workers/service-worker/registration-updateviacache.https.html has become flaky

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 4 13:30:11 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=243410

--- Comment #7 from Chris Dumez <cdumez at apple.com> ---
(In reply to Chris Dumez from comment #6)
> I do see one weirdness in our code here:
> ```
>     // If newestWorker is not null, newestWorker's script url equals job's
> script url with the exclude fragments
>     // flag set, and script's source text is a byte-for-byte match with
> newestWorker's script resource's source
>     // text, then:
>     if (newestWorker &&
> equalIgnoringFragmentIdentifier(newestWorker->scriptURL(), job.scriptURL) &&
> newestWorker->type() == job.workerType && result.script ==
> newestWorker->script() && doCertificatesMatch(result.certificateInfo,
> newestWorker->certificateInfo())) {
> ```
> 
> But the spec says at https://w3c.github.io/ServiceWorker/#start-register
> (step 5.2):
> ```
> If newestWorker is not null, job’s script url equals newestWorker’s script
> url, job’s worker type equals newestWorker’s type, and job’s update via
> cache mode's value equals registration’s update via cache mode, then:
> 
> Invoke Resolve Job Promise with job and registration.
> Invoke Finish Job with job and abort these steps.
> ```
> 
> It seems we are missing the "update via cache mode" check. I'll try to
> reproduce the flakiness locally and see if this fixes it.

Actually, we do have the updateViaCache check in runRegisterJob() already:
```
        auto* newestWorker = registration->getNewestWorker();
        if (newestWorker && equalIgnoringFragmentIdentifier(job.scriptURL, newestWorker->scriptURL()) && job.workerType == newestWorker->type() && job.registrationOptions.updateViaCache == registration->updateViaCache()) {
            RELEASE_LOG(ServiceWorker, "%p - SWServerJobQueue::runRegisterJob: Found directly reusable registration %llu for job %s (DONE)", this, registration->identifier().toUInt64(), job.identifier().loggingString().utf8().data());
            m_server.resolveRegistrationJob(job, registration->data(), ShouldNotifyWhenResolved::No);
            finishCurrentJob();
            return;
        }
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220804/20264bdf/attachment-0001.htm>


More information about the webkit-unassigned mailing list