Bug 239657

Summary: service worker update should refresh imported scripts in addition to the main script
Product: WebKit Reporter: youenn fablet <youennf>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, ews-watchlist, mkwst, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=243410
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description youenn fablet 2022-04-22 09:41:13 PDT
service worker update should refresh imported scripts in addition to the main script
Comment 1 youenn fablet 2022-04-22 10:09:36 PDT
Created attachment 458156 [details]
Patch
Comment 2 youenn fablet 2022-04-25 05:12:56 PDT
Created attachment 458260 [details]
Patch
Comment 3 youenn fablet 2022-04-25 05:38:17 PDT
Created attachment 458263 [details]
Patch
Comment 4 Chris Dumez 2022-04-26 08:01:17 PDT
Comment on attachment 458263 [details]
Patch

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

r=me

> Source/WebCore/workers/service/server/SWServer.cpp:567
> +            m_scripts.append(std::make_pair(url, WTFMove(result.script)));

Can probably just:
m_scripts.append({ url, WTFMove(result.script) });

> Source/WebCore/workers/service/server/SWServerJobQueue.cpp:114
> +        RELEASE_LOG(ServiceWorker, "%p - SWServerJobQueue::scriptFetchFinished, script, certificate and imported scripts are matching for registrationID=%llu", this, registration->identifier().toUInt64());

%llu -> PRIu64

> Source/WebCore/workers/service/server/SWServerJobQueue.cpp:135
> +        RELEASE_LOG(ServiceWorker, "%p - SWServerJobQueue::importedScriptsFetchFinished, script, certificate and imported scripts are matching for registrationID=%llu", this, registration->identifier().toUInt64());

PRIu64
Comment 5 youenn fablet 2022-04-27 00:45:15 PDT
Created attachment 458426 [details]
Patch
Comment 6 EWS 2022-04-27 06:13:37 PDT
Committed r293506 (250037@main): <https://commits.webkit.org/250037@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 458426 [details].
Comment 7 Radar WebKit Bug Importer 2022-04-27 06:14:15 PDT
<rdar://problem/92393337>