Re: [whatwg/fetch] Deferred fetching (PR #1647)

@mingyc commented on this pull request.



> +</dl>
+<hr>
+
+<p>A <dfn>deferred fetch record</dfn> is a <a for=/>struct</a> used to maintain state needed
+to invoke a fetch at a later time, e.g., when a {{Document}} object is unloaded or becomes
+not <a for=Document>fully active</a>. It has the following <a for=struct>items</a>:
+
+<dl>
+ <dt><dfn for="deferred fetch record">request</dfn>
+ <dd>A <a for=/>request</a>.
+
+ <dt><dfn for="deferred fetch record">notify invoked</dfn>
+ <dd>An algorithm accepting no arguments.
+
+ <dt><dfn for="deferred fetch record">invoke state</dfn> (default "<code>pending</code>")
+ <dd>"<code>pending</code>", "<code>fetching</code>", "<code>done</code>", or

> `done`

There were [extensive discussion](https://github.com/WICG/pending-beacon/issues/75) before about `sent` state (or similarly `done` here), and the conclusion is that we should not use this term in this API, as a fetchLater request may be processed in unload or in bfcached and once it is done the response may not be able to get back to the JS context.

Although this is just an internal state, it still requires knowledge of when a request is done from the view of a renderer (document), which is difficult to get right in async.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1647#pullrequestreview-2566223177
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1647/review/2566223177@github.com>

Received on Wednesday, 22 January 2025 05:30:55 UTC