Re: [whatwg/fetch] Aborting a fetch: The Next Generation (#447)

> Huh, maybe I'm misunderstanding what you're asking for. I thought "responding with headers" would be between sending the response and receiving headers.

OK, so we can avoid confusion over things like whether "receiving headers" means *the process of* receiving headers or the point at which we've *finished* receiving headers, here's the complete list, off the top of my head, of every state, and transition step, a fetch goes through (in the traditional normally-completing HTTP request/response model, ignoring how premature termination or HTTP/2 may complicate these):

- State Null: Nothing has been sent, no connection has been opened.
- **Step 1**: A connection has been opened to the server, putting us into **State A**.
- **Step 2**: The client begins sending their request to the server, entering **State B**.
- **Step 3**: The client finishes sending the path, method, and headers of their request to the server, and begins sending the body of their request (if any) in **State C**.
- **Step 4**: The client finishes their request (headers and optional body), and begins waiting in **State D** for an acknowledgement from the server.
- **Step 5**: The client has received an acknowledgement of its request from the server, putting the fetch into **State E** as it begins receiving the response.
- **Step 6**: The client has received the status and headers of the request, putting the fetch in **State F** as it continues to receive the body content (if any) of the response.
- **Step 7**: The client finishes receiving the response from the server altogether, putting the fetch into **State G** (completion).

I'm talking about differentiating State E and State F, here, where State E is "responding with headers" and State F is "responding with body". I guess XHR's readyState 1 combines State A through State E, so this *could* potentially reveal meaningful timing information for Step 5 relative to Step 6 (which is when XHR fires `readystatechange` to [readyState 2](https://xhr.spec.whatwg.org/#dom-xmlhttprequest-readystate)) - however, exposing a combined state for *the entirety of a response being received* (combining State E and State F) would *also* expose Step 5 (though not exposing Step 6, which *would* be exposed under XHR).

I mean, maybe I'm misinterpreting XHR's readyState values - I readily admit that I don't see much distinction in readyState 2 versus readyState 3 (they'd both fall under Step 6 in the model I described above - maybe States C and F above should be split on this distinction?) - but this seems like a sensible level of granularity to describe fetches under.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/447#issuecomment-292789807

Received on Sunday, 9 April 2017 14:40:02 UTC