Bug 182416 - When SW install fails, null out registration.installing before setting worker state to "redundant"
Summary: When SW install fails, null out registration.installing before setting worker...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://github.com/w3c/ServiceWorker/...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-02-01 18:55 PST by Chris Dumez
Modified: 2018-02-01 23:09 PST (History)
6 users (show)

See Also:


Attachments
Patch (7.85 KB, patch)
2018-02-01 19:02 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (7.64 KB, patch)
2018-02-01 20:49 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2018-02-01 18:55:52 PST
When SW install fails, null out registration.installing before setting worker state to "redundant". This does not match the spec but this is what Firefox and Chrome do. This is also what the web-platform-tests expect.
Comment 1 Radar WebKit Bug Importer 2018-02-01 18:57:28 PST
<rdar://problem/37141997>
Comment 2 Chris Dumez 2018-02-01 19:02:55 PST
Created attachment 332931 [details]
Patch
Comment 3 youenn fablet 2018-02-01 20:21:42 PST
Comment on attachment 332931 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332931&action=review

> Source/WebCore/ChangeLog:10
> +        This does not match the spec but this is what Firefox and Chrome do. This is also what the

Change makes sense to me. Can we file an issue against the spec?

> LayoutTests/ChangeLog:9
> +        Add layout test coverage. I have verified that this test is passing in both Firefox and Chrome.

Since this test is useful to ensure interop with Chrome and Firefox will be kept, it would be good to make this as a WPT test.
Given how the test is simple, making it a WPT test should be straightforward.

> LayoutTests/http/tests/workers/service/resources/install-fails-worker.js:5
> +        }, 10);

I am not clear why we need to have a 10 millisecond timer there.
Cannot we just write "event.waitUntil(Promise.reject());"
Comment 4 Chris Dumez 2018-02-01 20:47:07 PST
Comment on attachment 332931 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332931&action=review

>> Source/WebCore/ChangeLog:10
>> +        This does not match the spec but this is what Firefox and Chrome do. This is also what the
> 
> Change makes sense to me. Can we file an issue against the spec?

Yes. I'll do that.

>> LayoutTests/ChangeLog:9
>> +        Add layout test coverage. I have verified that this test is passing in both Firefox and Chrome.
> 
> Since this test is useful to ensure interop with Chrome and Firefox will be kept, it would be good to make this as a WPT test.
> Given how the test is simple, making it a WPT test should be straightforward.

Are you not satisfied with the existing WPT test? I wrote this one for clarity and to cover only the exact case. However, the WPT test does cover this change since it started passing.

>> LayoutTests/http/tests/workers/service/resources/install-fails-worker.js:5
>> +        }, 10);
> 
> I am not clear why we need to have a 10 millisecond timer there.
> Cannot we just write "event.waitUntil(Promise.reject());"

Ok.
Comment 5 Chris Dumez 2018-02-01 20:49:02 PST
Created attachment 332936 [details]
Patch
Comment 6 WebKit Commit Bot 2018-02-01 23:09:30 PST
Comment on attachment 332936 [details]
Patch

Clearing flags on attachment: 332936

Committed r227997: <https://trac.webkit.org/changeset/227997>
Comment 7 WebKit Commit Bot 2018-02-01 23:09:32 PST
All reviewed patches have been landed.  Closing bug.