Skip to content

Conversation

yoshisatoyanagisawa
Copy link
Collaborator

@yoshisatoyanagisawa yoshisatoyanagisawa commented Jun 12, 2025

This is a follow up of #1777 (comment).
https://infra.spec.whatwg.org/#abort-when adds the check each time the step is executed. However, there is only a step between and the abort-when and if-aborted, it should be less effective abort than we expect. Let me add a step inside the callback in case.


Preview | Diff

@yoshisatoyanagisawa yoshisatoyanagisawa changed the title Fix less fragile |fetchController| termination check Less fragile |fetchController| termination check Jun 12, 2025
@yoshisatoyanagisawa
Copy link
Collaborator Author

@domenic will you take a look?

docs/index.bs Outdated
@@ -3265,6 +3265,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "<code>pending</code>".
1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think since there is only one substep, it's better to restructure this to remove "abort when" / "if aborted" entirely:

  1. Run the following steps in parallel:
    1. If fetchController's state is "terminated" or "aborted", then:
      1. Abort raceFetchController.
      2. Set raceResponse to a race response whose value is null.
    2. Set raceFetchController to the result of fetching given request, with processResponse set to the following steps given a response raceNetworkRequestResponse:
      1. If fetchController's state is "terminated" or "aborted", then ...
      2. ...

This is equivalent to what is currently written, but clearer.

The same comment applies below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I closed this by accident and not sure how to reopen. I opened the new one in #1780.
Since I think we need to abort the steps, I revised it to set [=abort when=] in the one level down step.
Please see the PR 1780.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants