From 5ea459931c63c7b4d08291ae3554a273106c4213 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 30 Sep 2021 13:15:34 +0300 Subject: [PATCH 01/17] Attach timing info and URL to network errors Set an opaque timing info and the original request URL to the error resposne, and call the processResponseDone callback to allow the caller to report it. This should already be the case for reporting network errors in the fetch() API. Closes #1215 Set network error timing info and URL at the start of fetch finale Rearrange fetch finale step Make sure we don't report network errors twice Use queues for synchronization --- fetch.bs | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/fetch.bs b/fetch.bs index c1f54a21d..311532e26 100644 --- a/fetch.bs +++ b/fetch.bs @@ -203,6 +203,8 @@ lt="authentication entry">authentication entries (for HTTP authentication).
Null, a global object, or a parallel queue.
cross-origin isolated capability (default false) +
ready for clients (default false). +
network read complete (default false).
A boolean.
timing info @@ -4194,6 +4196,27 @@ steps: response response, run these steps:
    +
  1. +

    If response is a network error, then: + +

      +
    1. +

      Set response's URL list to « fetchParams's + request's URL list ≫. + +

      This is needed as after cloning fetchParams's + request's URL list earlier, response + might have been set to a network error.

      +
    2. + +
    3. Set response's timing info to the result of + creating an opaque timing info for fetchParams's + timing info.

    4. + +
    5. Set fetchParams's network read complete to true. +

    +
  2. +
  3. If fetchParams's process response is non-null, then queue a fetch task to run fetchParams's process response given response, with fetchParams's @@ -4219,19 +4242,43 @@ steps: processBody, processBodyError, and fetchParams's task destination.

+ + +
  • +

    Queue a fetch task to run the following steps with fetchParams's + task destination:

    + +
      +
    1. Set fetchParams's ready for clients to true.

    2. + +
    3. Finalize response given fetchParams and response.

    4. +
    + + +

    To fetch network finale given a fetch params fetchParams +and a response response, queue a fetch task +with to run the following steps with fetchParams's +task destination:

    + +
      +
    1. Set fetchParams's network read complete.

    2. + +
    3. Finalize response given fetchParams and response.

    To finalize response given a fetch params fetchParams and a response response, run these steps:

      +
    1. IffetchParams's ready for clients is false or + fetchParams's network read complete is false, return.

    2. +
    3. Set fetchParams's request's done flag.

    4. If fetchParams's process response done is not null, - then queue a fetch task to run fetchParams's - process response done given response, - with fetchParams's task destination. + then run fetchParams's process response done with + response.

    To finalize and report timing given a response @@ -5580,7 +5627,7 @@ optional boolean forceNewConnection (default false), run these steps:

  • Otherwise, if the bytes transmission for response's message body is done normally and stream is readable, then - close stream, finalize response for + close stream, run fetch network finale for fetchParams and response, and abort these in-parallel steps. @@ -5589,7 +5636,7 @@ optional boolean forceNewConnection (default false), run these steps:

    If aborted, then:

      -
    1. Finalize response for fetchParams and response. +
    2. Run fetch network finale for fetchParams and response.
    3. Let aborted be the termination's aborted flag. From 661fb0b4a08cf6cd441e92065b490fe5e8080ccc Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 8 Nov 2021 10:43:54 +0200 Subject: [PATCH 02/17] nit --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 311532e26..1f89d4d02 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4257,7 +4257,7 @@ steps:

      To fetch network finale given a fetch params fetchParams and a response response, queue a fetch task -with to run the following steps with fetchParams's +given the following steps with fetchParams's task destination:

        From 58372b5187e725923f923e618e14aafcebac9f41 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 22 Nov 2021 09:15:29 +0200 Subject: [PATCH 03/17] Don't report non-https and aborts --- fetch.bs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fetch.bs b/fetch.bs index 1f89d4d02..8fc8244ef 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4286,6 +4286,8 @@ given the following steps with fetchParams's initiatorType (default "other"), run these steps:
          +
        1. If response is an aborted network error, then return. +

        2. If response's URL list is null or empty, then return. @@ -4295,6 +4297,9 @@ given the following steps with fetchParams's

        3. Let cacheState be response's cache state. +

        4. If originalURL's scheme is not an HTTP(S) scheme, then + return. +

        5. If timingInfo is null, then return.

        6. From f6b8650b781aa2b727c35090260df96ebae7bd20 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 11:22:07 +0200 Subject: [PATCH 04/17] Review nits --- fetch.bs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 8fc8244ef..cae7d5290 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4217,6 +4217,9 @@ steps:
        +
      1. If response's cache state is not the empty string, then + set fetchParams's network read complete to true.

      2. +
      3. If fetchParams's process response is non-null, then queue a fetch task to run fetchParams's process response given response, with fetchParams's @@ -4261,7 +4264,8 @@ given the following steps with fetchParams's task destination:

          -
        1. Set fetchParams's network read complete.

        2. +
        3. Set fetchParams's + network read complete to true.

        4. Finalize response given fetchParams and response.

        @@ -4270,7 +4274,7 @@ given the following steps with fetchParams's response response, run these steps:
          -
        1. IffetchParams's ready for clients is false or +

        2. If fetchParams's ready for clients is false or fetchParams's network read complete is false, return.

        3. Set fetchParams's request's From c4ebaad2d5fe60768c9806be2fe19a4a0cbce95e Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 12:52:29 +0200 Subject: [PATCH 05/17] Use TransformStream/flush for processResponseEnd --- fetch.bs | 68 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/fetch.bs b/fetch.bs index cae7d5290..4ef7cac46 100644 --- a/fetch.bs +++ b/fetch.bs @@ -203,8 +203,6 @@ lt="authentication entry">authentication entries (for HTTP authentication).

          Null, a global object, or a parallel queue.
          cross-origin isolated capability (default false) -
          ready for clients (default false). -
          network read complete (default false).
          A boolean.
          timing info @@ -4212,30 +4210,39 @@ steps:
        4. Set response's timing info to the result of creating an opaque timing info for fetchParams's timing info.

        5. - -
        6. Set fetchParams's network read complete to true.

      4. -
      5. If response's cache state is not the empty string, then - set fetchParams's network read complete to true.

      6. -
      7. If fetchParams's process response is non-null, then queue a fetch task to run fetchParams's process response given response, with fetchParams's task destination. +

      8. Let finalize be this step: finalize response given fetchParams + and response. +

      9. If fetchParams's process response end-of-body is non-null, then:

          +
        1. +

          Let processEndOfBody given nullBytesOrFailure be the following + steps: + +

            +
          1. Run finalize. + +

          2. Run fetchParams's process response end-of-body + given response and nullBytesOrFailure. +

          +
        2. +
        3. Let processBody given nullOrBytes be this step: run - fetchParams's process response end-of-body given - response and nullOrBytes. + processEndOfBody with nullOrBytes. -

        4. Let processBodyError be this step: run fetchParams's - process response end-of-body given response and failure. +

        5. Let processBodyError be this step: run processEndOfBodygiven + failure.

        6. If response's body is null, then queue a fetch task to run processBody given null, with fetchParams's @@ -4248,41 +4255,35 @@ steps:

        7. -

          Queue a fetch task to run the following steps with fetchParams's - task destination:

          +

          Otherwise, if response's body is not null and is + readable, then:

            -
          1. Set fetchParams's ready for clients to true.

          2. +
          3. Let transformStream be a new a {{TransformStream}}. -

          4. Finalize response given fetchParams and response.

          5. -
          -
        +
      10. Let identityTransformAlgorithm be an algorithm which, given chunk, + enqueues chunk in transformStream. -

        To fetch network finale given a fetch params fetchParams -and a response response, queue a fetch task -given the following steps with fetchParams's -task destination:

        - -
          -
        1. Set fetchParams's - network read complete to true.

        2. +
        3. Set response's body to the result of + setting up transformStream with + identityTransformAlgorithm and finalize. +

        +
      11. -
      12. Finalize response given fetchParams and response.

      13. +
      14. Otherwise, run finalize.

      To finalize response given a fetch params fetchParams and a response response, run these steps:

        -
      1. If fetchParams's ready for clients is false or - fetchParams's network read complete is false, return.

      2. -
      3. Set fetchParams's request's done flag.

      4. If fetchParams's process response done is not null, - then run fetchParams's process response done with - response. + then queue a fetch task to run fetchParams's + process response done given response with + fetchParams's task destination.

      To finalize and report timing given a response @@ -5636,8 +5637,7 @@ optional boolean forceNewConnection (default false), run these steps:

    4. Otherwise, if the bytes transmission for response's message body is done normally and stream is readable, then - close stream, run fetch network finale for - fetchParams and response, and abort these in-parallel steps. + close stream, and abort these in-parallel steps.

    @@ -5645,7 +5645,7 @@ optional boolean forceNewConnection (default false), run these steps:

    If aborted, then:

      -
    1. Run fetch network finale for fetchParams and response. +
    2. Finalize response given fetchParams and response.

    3. Let aborted be the termination's aborted flag. From 05b0f9923afc71eea859833912c363497d8ff768 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 13:17:54 +0200 Subject: [PATCH 06/17] Update fetch.bs Co-authored-by: Mattias Buelens <649348+MattiasBuelens@users.noreply.github.com> --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 4ef7cac46..cb199cde7 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4262,7 +4262,7 @@ steps:

    4. Let transformStream be a new a {{TransformStream}}.

    5. Let identityTransformAlgorithm be an algorithm which, given chunk, - enqueues chunk in transformStream. + enqueues chunk in transformStream.

    6. Set response's body to the result of setting up transformStream with From 7d8342eeb25b3edd53dd74bf69156ca865d871e5 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 13:18:16 +0200 Subject: [PATCH 07/17] Use pipe-through wording --- fetch.bs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index cb199cde7..625b73b02 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4264,9 +4264,12 @@ steps:

    7. Let identityTransformAlgorithm be an algorithm which, given chunk, enqueues chunk in transformStream. -

    8. Set response's body to the result of - setting up transformStream with +

    9. Set up transformStream with identityTransformAlgorithm and finalize. + +

    10. Set response's body to the result of + piping response's + body through transformStream.

  • From 7f2e766975a830c8dfc2447607cfc24de84a99a3 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 13:59:32 +0200 Subject: [PATCH 08/17] Switch order around --- fetch.bs | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/fetch.bs b/fetch.bs index 625b73b02..ddb304d8f 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4213,6 +4213,25 @@ steps: +
  • +

    Otherwise, if response's body is not null and is + readable, then: + +

      +
    1. Let transformStream be a new a {{TransformStream}}. + +

    2. Let identityTransformAlgorithm be an algorithm which, given chunk, + enqueues chunk in transformStream. + +

    3. Set up transformStream with + identityTransformAlgorithm and finalize. + +

    4. Set response's body to the result of + piping response's + body through transformStream. +

    +
  • +
  • If fetchParams's process response is non-null, then queue a fetch task to run fetchParams's process response given response, with fetchParams's @@ -4254,26 +4273,8 @@ steps:

  • -
  • -

    Otherwise, if response's body is not null and is - readable, then: - -

      -
    1. Let transformStream be a new a {{TransformStream}}. - -

    2. Let identityTransformAlgorithm be an algorithm which, given chunk, - enqueues chunk in transformStream. - -

    3. Set up transformStream with - identityTransformAlgorithm and finalize. - -

    4. Set response's body to the result of - piping response's - body through transformStream. -

    -
  • - -
  • Otherwise, run finalize.

  • +
  • If response's body is null or + not readable, then run finalize.

  • To finalize response given a fetch params fetchParams and a From 92bb3c044cee00b907b50ef1542c9ebc1d560eb8 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 14:41:48 +0200 Subject: [PATCH 09/17] Inline finalize response --- fetch.bs | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/fetch.bs b/fetch.bs index ddb304d8f..a5781313b 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4214,8 +4214,10 @@ steps:

  • -

    Otherwise, if response's body is not null and is - readable, then: +

  • Let hasReadableStream be true if response's body + is not null and is readable; otherwise false. + +

  • If hasReadableStream is true, then:

    1. Let transformStream be a new a {{TransformStream}}. @@ -4224,7 +4226,7 @@ steps: enqueues chunk in transformStream.

    2. Set up transformStream with - identityTransformAlgorithm and finalize. + identityTransformAlgorithm and processResponseDone.

    3. Set response's body to the result of piping response's @@ -4237,8 +4239,19 @@ steps: process response given response, with fetchParams's task destination. -

    4. Let finalize be this step: finalize response given fetchParams - and response. +

    5. +

      Let processResponseDone be the following steps: + +

        +
      1. Set fetchParams's request's + done flag. + +

      2. If fetchParams's process response done is not null, + then queue a fetch task to run fetchParams's + process response done given response with + fetchParams's task destination. +

      +
    6. If fetchParams's process response end-of-body is non-null, @@ -4250,7 +4263,7 @@ steps: steps:

        -
      1. Run finalize. +

      2. Run processResponseDone.

      3. Run fetchParams's process response end-of-body given response and nullBytesOrFailure. @@ -4273,21 +4286,7 @@ steps:

    7. -
    8. If response's body is null or - not readable, then run finalize.

    9. -
    - -

    To finalize response given a fetch params fetchParams and a -response response, run these steps: - -

      -
    1. Set fetchParams's request's - done flag. - -

    2. If fetchParams's process response done is not null, - then queue a fetch task to run fetchParams's - process response done given response with - fetchParams's task destination. +

    3. If hasReadableStream is false, then run processResponseDone.

    To finalize and report timing given a response @@ -5649,8 +5648,6 @@ optional boolean forceNewConnection (default false), run these steps:

    If aborted, then:

      -
    1. Finalize response given fetchParams and response.

    2. -
    3. Let aborted be the termination's aborted flag.

    4. From 8b606f5579456239a54b401b94177d8dc518b4b6 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 14:45:29 +0200 Subject: [PATCH 10/17] Fix
    5. --- fetch.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index a5781313b..1d6fa5703 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4213,11 +4213,11 @@ steps:
  • -
  • -
  • Let hasReadableStream be true if response's body - is not null and is readable; otherwise false. +

  • Let hasReadableStream be true if response's body + is not null and is readable; otherwise false. -

  • If hasReadableStream is true, then: +

  • +

    If hasReadableStream is true, then:

    1. Let transformStream be a new a {{TransformStream}}. From c77c8cebada58165a1f0324a2784cc81e031fc5b Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 29 Nov 2021 14:55:24 +0200 Subject: [PATCH 11/17] Switch order around --- fetch.bs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fetch.bs b/fetch.bs index 1d6fa5703..176325d25 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4216,6 +4216,20 @@ steps:

    2. Let hasReadableStream be true if response's body is not null and is readable; otherwise false. +

    3. +

      Let processResponseDone be the following steps: + +

        +
      1. Set fetchParams's request's + done flag. + +

      2. If fetchParams's process response done is not null, + then queue a fetch task to run fetchParams's + process response done given response with + fetchParams's task destination. +

      +
    4. +
    5. If hasReadableStream is true, then: @@ -4239,20 +4253,6 @@ steps: process response given response, with fetchParams's task destination. -

    6. -

      Let processResponseDone be the following steps: - -

        -
      1. Set fetchParams's request's - done flag. - -

      2. If fetchParams's process response done is not null, - then queue a fetch task to run fetchParams's - process response done given response with - fetchParams's task destination. -

      -
    7. -
    8. If fetchParams's process response end-of-body is non-null, then: From a0dbe2116ce37f0bf63ded61d3c39f1e3221603b Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Fri, 3 Dec 2021 15:06:28 +0200 Subject: [PATCH 12/17] Simplify fetch finale --- fetch.bs | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/fetch.bs b/fetch.bs index 176325d25..f930b74b8 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4200,7 +4200,7 @@ steps:

      1. Set response's URL list to « fetchParams's - request's URL list ≫. + request's URL list[0] ≫.

        This is needed as after cloning fetchParams's request's URL list earlier, response @@ -4213,9 +4213,6 @@ steps:

    9. -
    10. Let hasReadableStream be true if response's body - is not null and is readable; otherwise false. -

    11. Let processResponseDone be the following steps: @@ -4230,8 +4227,11 @@ steps:

  • +
  • If response's body is null, then run + processResponseDone. +

  • -

    If hasReadableStream is true, then: +

    Otherwise:

    1. Let transformStream be a new a {{TransformStream}}. @@ -4240,12 +4240,16 @@ steps: enqueues chunk in transformStream.

    2. Set up transformStream with - identityTransformAlgorithm and processResponseDone. + [=TransformStream/set up/transformalgorithm=] set to identityTransformAlgorithm and + [=TransformStream/set up/flushalgorithm=] set to processResponseDone.

    3. Set response's body to the result of piping response's body through transformStream.

    + +

    This {{TransformStream}} is needed for the purpose of receiving a notification when + the stream reaches its end, and is otherwise an [=identity transform stream=].

  • If fetchParams's process response is non-null, then @@ -4258,23 +4262,12 @@ steps: then:

      -
    1. -

      Let processEndOfBody given nullBytesOrFailure be the following - steps: - -

        -
      1. Run processResponseDone. - -

      2. Run fetchParams's process response end-of-body - given response and nullBytesOrFailure. -

      -
    2. -
    3. Let processBody given nullOrBytes be this step: run - processEndOfBody with nullOrBytes. + fetchParams's process response end-of-body given + response and nullOrBytes. -

    4. Let processBodyError be this step: run processEndOfBodygiven - failure. +

    5. Let processBodyError be this step: run fetchParams's + process response end-of-body given response and failure.

    6. If response's body is null, then queue a fetch task to run processBody given null, with fetchParams's @@ -4285,8 +4278,6 @@ steps: task destination.

  • - -
  • If hasReadableStream is false, then run processResponseDone.

  • To finalize and report timing given a response From 21ef0b9efb8ac1cc3e1e3bbe71e5ae2452d45409 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 7 Dec 2021 14:22:00 +0200 Subject: [PATCH 13/17] Use correct list closer --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index f930b74b8..4acf6d4a9 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4200,7 +4200,7 @@ steps:

    1. Set response's URL list to « fetchParams's - request's URL list[0] ≫. + request's URL list[0] ».

      This is needed as after cloning fetchParams's request's URL list earlier, response From 3659cdff0040ae20f96582229fff50bb8f0cb6e2 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 7 Dec 2021 14:40:57 +0200 Subject: [PATCH 14/17] Reorder and fix some nits --- fetch.bs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/fetch.bs b/fetch.bs index 4acf6d4a9..40591cf12 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4227,6 +4227,11 @@ steps:

    +
  • If fetchParams's process response is non-null, then + queue a fetch task to run fetchParams's + process response given response, with fetchParams's + task destination. +

  • If response's body is null, then run processResponseDone. @@ -4240,8 +4245,8 @@ steps: enqueues chunk in transformStream.

  • Set up transformStream with - [=TransformStream/set up/transformalgorithm=] set to identityTransformAlgorithm and - [=TransformStream/set up/flushalgorithm=] set to processResponseDone. + transformAlgorithm set to identityTransformAlgorithm and + flushAlgorithm set to processResponseDone.

  • Set response's body to the result of piping response's @@ -4249,13 +4254,7 @@ steps:

    This {{TransformStream}} is needed for the purpose of receiving a notification when - the stream reaches its end, and is otherwise an [=identity transform stream=]. -

  • - -
  • If fetchParams's process response is non-null, then - queue a fetch task to run fetchParams's - process response given response, with fetchParams's - task destination. + the stream reaches its end, and is otherwise an identity transform stream.

  • If fetchParams's process response end-of-body is non-null, @@ -4277,7 +4276,6 @@ steps: processBody, processBodyError, and fetchParams's task destination. -

  • To finalize and report timing given a response From 566580ee449732aa65882c03e0a4d98f81e2e171 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 7 Dec 2021 15:16:07 +0200 Subject: [PATCH 15/17] Switch order --- fetch.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index 40591cf12..e587da8cd 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4232,11 +4232,8 @@ steps: process response given response, with fetchParams's task destination. -

  • If response's body is null, then run - processResponseDone. -

  • -

    Otherwise:

    +

    If response's body is not null, then:

    1. Let transformStream be a new a {{TransformStream}}. @@ -4276,6 +4273,9 @@ steps: processBody, processBodyError, and fetchParams's task destination.

    + +
  • If response's body is null, then run + processResponseDone.

    To finalize and report timing given a response From ea0caaa2fd0552e2545f9272e4b1e952e6b90d49 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 7 Dec 2021 15:22:03 +0200 Subject: [PATCH 16/17] Fix i tag --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index e587da8cd..3f5a6e69c 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4242,7 +4242,7 @@ steps: enqueues chunk in transformStream.

  • Set up transformStream with - transformAlgorithm set to identityTransformAlgorithm and + transformAlgorithm set to identityTransformAlgorithm and flushAlgorithm set to processResponseDone.

  • Set response's body to the result of From 78010e33706299ce7ba3d1bcc928c5897c9fd7cb Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Mon, 13 Dec 2021 13:55:33 +0200 Subject: [PATCH 17/17] Revert "Switch order" This reverts commit 566580ee449732aa65882c03e0a4d98f81e2e171. --- fetch.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index 3f5a6e69c..a374e58f0 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4232,8 +4232,11 @@ steps: process response given response, with fetchParams's task destination. +

  • If response's body is null, then run + processResponseDone. +

  • -

    If response's body is not null, then: +

    Otherwise:

    1. Let transformStream be a new a {{TransformStream}}. @@ -4273,9 +4276,6 @@ steps: processBody, processBodyError, and fetchParams's task destination.

    - -
  • If response's body is null, then run - processResponseDone.

    To finalize and report timing given a response