From f7809ff853c5ff6177e60fb7244f0a97e29ccb4b Mon Sep 17 00:00:00 2001 From: sisidovski Date: Wed, 14 Feb 2024 18:41:55 +0900 Subject: [PATCH 1/6] Add service-workers race token to request and its lookup --- fetch.bs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fetch.bs b/fetch.bs index 58579420d..faff5d460 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1724,6 +1724,10 @@ is "all" or "none". Unless stated otherwise it is " +

A request has an associated service-workers race token (a string). Unless stated otherwise it is null. + +

This is only set by handle fetch in service workers. +

A request has an associated initiator, which is the empty string, @@ -4523,6 +4527,22 @@ steps:

  • Return fetchParams's preloaded response candidate. +

    request's service-workers race token is not null +
    +
      +
    1. Let raceReesponse to the result of [=lookup-race-response=] given request's service-workers race token, request's reserved client, request's URL. +

    2. If raceReesponse is non-null, then: +

        +
      1. Wait until raceReesponse settles. +

      2. If raceReesponse resolves with response, then: +

          +
        1. Assert: response is a response. +

        2. Return response. +

        +
      3. If raceReesponse rejects, return a network error. +

      +
    +
    request's current URL's origin is same origin with request's origin, and request's response tainting is "basic" From 3b11f7064996e4d7c7ea4b3a64c24cea8afc0937 Mon Sep 17 00:00:00 2001 From: sisidovski Date: Fri, 16 Feb 2024 04:30:49 +0900 Subject: [PATCH 2/6] Use [=lookup-race-response=] --- fetch.bs | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/fetch.bs b/fetch.bs index faff5d460..9faa7ca08 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1724,10 +1724,6 @@ is "all" or "none". Unless stated otherwise it is " -

    A request has an associated service-workers race token (a string). Unless stated otherwise it is null. - -

    This is only set by handle fetch in service workers. -

    A request has an associated initiator, which is the empty string, @@ -4510,6 +4506,9 @@ steps:

  • If recursive is false, then run the remaining steps in parallel. +

  • Let |raceReesponse| be the result of [=lookup-race-response=]. +

  • If |raceReesponse| is response, return |raceReesponse|. +

  • If response is null, then set response to the result of running the steps corresponding to the first matching statement: @@ -4527,22 +4526,6 @@ steps:

  • Return fetchParams's preloaded response candidate. -

    request's service-workers race token is not null -
    -
      -
    1. Let raceReesponse to the result of [=lookup-race-response=] given request's service-workers race token, request's reserved client, request's URL. -

    2. If raceReesponse is non-null, then: -

        -
      1. Wait until raceReesponse settles. -

      2. If raceReesponse resolves with response, then: -

          -
        1. Assert: response is a response. -

        2. Return response. -

        -
      3. If raceReesponse rejects, return a network error. -

      -
    -
    request's current URL's origin is same origin with request's origin, and request's response tainting is "basic" From 542bc702eb69578a45daf2486a25068445c3db42 Mon Sep 17 00:00:00 2001 From: sisidovski Date: Mon, 19 Feb 2024 09:22:53 +0900 Subject: [PATCH 3/6] Add Shunya Shishido in Acknowledgments --- fetch.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch.bs b/fetch.bs index 9faa7ca08..a47008962 100644 --- a/fetch.bs +++ b/fetch.bs @@ -9164,6 +9164,7 @@ Shao-xuan Kang, Sharath Udupa, Shivakumar Jagalur Matt, Shivani Sharma, +宍戸俊哉 (Shunya Shishido), Sigbjørn Finne, Simon Pieters, Simon Sapin, From b667fec985cbf5f01a5d2f0cb08b426585b6e660 Mon Sep 17 00:00:00 2001 From: sisidovski Date: Thu, 22 Feb 2024 09:59:08 +0900 Subject: [PATCH 4/6] Update to pass request --- fetch.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index a47008962..110081f8b 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4506,8 +4506,8 @@ steps:
  • If recursive is false, then run the remaining steps in parallel. -

  • Let |raceReesponse| be the result of [=lookup-race-response=]. -

  • If |raceReesponse| is response, return |raceReesponse|. +

  • Let |raceResponse| be the result of lookup race response given request. +

  • If |raceResponse| is response, return |raceResponse|.

  • If response is null, then set response to the result of running the steps From fca378f2959c11c88879935d86eca09487a77672 Mon Sep 17 00:00:00 2001 From: sisidovski Date: Thu, 22 Feb 2024 14:52:12 +0900 Subject: [PATCH 5/6] Fix |raceResponse| result to check if it is s a response --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 110081f8b..00bdbbcd2 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4507,7 +4507,7 @@ steps:

  • If recursive is false, then run the remaining steps in parallel.

  • Let |raceResponse| be the result of lookup race response given request. -

  • If |raceResponse| is response, return |raceResponse|. +

  • If |raceResponse| is a response, return |raceResponse|.

  • If response is null, then set response to the result of running the steps From d71bbb731455b68c97894307d41a17296b2a21b3 Mon Sep 17 00:00:00 2001 From: sisidovski Date: Thu, 22 Feb 2024 15:22:46 +0900 Subject: [PATCH 6/6] Add blank --- fetch.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch.bs b/fetch.bs index 00bdbbcd2..381cade3c 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4507,6 +4507,7 @@ steps:

  • If recursive is false, then run the remaining steps in parallel.

  • Let |raceResponse| be the result of lookup race response given request. +

  • If |raceResponse| is a response, return |raceResponse|.