Bug 226374 - Go to network in case fetch event is not yet responded when being destroyed instead of failing the load
Summary: Go to network in case fetch event is not yet responded when being destroyed i...
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: 2021-05-28 06:09 PDT by youenn fablet
Modified: 2021-05-31 01:29 PDT (History)
4 users (show)

See Also:


Attachments
Patch (12.35 KB, patch)
2021-05-28 06:19 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (12.40 KB, patch)
2021-05-31 00:19 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 2021-05-28 06:09:46 PDT
<rdar://78298472>
Comment 1 youenn fablet 2021-05-28 06:19:28 PDT
Created attachment 430007 [details]
Patch
Comment 2 Alex Christensen 2021-05-28 09:15:46 PDT
Comment on attachment 430007 [details]
Patch

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

> Source/WebCore/testing/ServiceWorkerInternals.cpp:63
> +        if (!result.has_value()) {

It looks like this whole change could just be a value_or({ })
Comment 3 Darin Adler 2021-05-29 22:43:48 PDT
Comment on attachment 430007 [details]
Patch

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

> Source/WebCore/testing/ServiceWorkerInternals.cpp:67
> +            auto& error = result.error();
> +            String description;
> +            if (error)
> +                description = error->localizedDescription();

Nice way to write this:

    String description;
    if (auto& error = result.error())
        description = error->localizedDescription();
Comment 4 youenn fablet 2021-05-31 00:19:34 PDT
Created attachment 430182 [details]
Patch for landing
Comment 5 youenn fablet 2021-05-31 01:20:57 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 430007 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430007&action=review
> 
> > Source/WebCore/testing/ServiceWorkerInternals.cpp:67
> > +            auto& error = result.error();
> > +            String description;
> > +            if (error)
> > +                description = error->localizedDescription();
> 
> Nice way to write this:
> 
>     String description;
>     if (auto& error = result.error())
>         description = error->localizedDescription();

Done
Comment 6 EWS 2021-05-31 01:29:09 PDT
Committed r278274 (238311@main): <https://commits.webkit.org/238311@main>

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