Bug 237827 - Keep service workers alive when they are inspected even though they should be terminated
Summary: Keep service workers alive when they are inspected even though they should be...
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: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-14 06:32 PDT by youenn fablet
Modified: 2022-03-18 00:34 PDT (History)
5 users (show)

See Also:


Attachments
Patch (19.61 KB, patch)
2022-03-15 04:24 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (36.79 KB, patch)
2022-03-16 07:14 PDT, youenn fablet
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (36.66 KB, patch)
2022-03-16 07:56 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (32.63 KB, patch)
2022-03-16 09:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2022-03-14 06:32:43 PDT
Keep service workers alive when they are inspected even though they should be terminated
Comment 1 youenn fablet 2022-03-14 08:58:31 PDT
<rdar://88313935>
Comment 2 youenn fablet 2022-03-15 04:24:13 PDT
Created attachment 454693 [details]
Patch
Comment 3 youenn fablet 2022-03-16 07:14:34 PDT
Created attachment 454830 [details]
Patch
Comment 4 youenn fablet 2022-03-16 07:56:19 PDT
Created attachment 454833 [details]
Patch
Comment 5 youenn fablet 2022-03-16 09:01:16 PDT
Created attachment 454843 [details]
Patch
Comment 6 youenn fablet 2022-03-17 08:21:25 PDT
Comment on attachment 454843 [details]
Patch

Error unrelated
Comment 7 Alex Christensen 2022-03-17 14:12:29 PDT
Comment on attachment 454843 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm:548
> +    // We delay so that the push message will happen before the unregistration of the service worker client.
> +    sleep(0.5);

Wouldn't this be better to wait until pushMessageProcessed is true?
Comment 8 youenn fablet 2022-03-18 00:14:25 PDT
(In reply to Alex Christensen from comment #7)
> Comment on attachment 454843 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=454843&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm:548
> > +    // We delay so that the push message will happen before the unregistration of the service worker client.
> > +    sleep(0.5);
> 
> Wouldn't this be better to wait until pushMessageProcessed is true?

The service worker is waiting to resolve the push message when there is no more clients, so we cannot wait here, we wait after we close the client.
Comment 9 EWS 2022-03-18 00:34:25 PDT
Committed r291467 (248583@main): <https://commits.webkit.org/248583@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 454843 [details].