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

> The spec can be changed to synchronize with the event loop that waits for the background timeout.

We need to say that the update cannot happen while a task is running on the document event loop.

I thought the event loop was stopped in BFCache. That is incorrect. What actually happens is described [here](https://html.spec.whatwg.org/multipage/webappapis.html#concept-task-runnable).

> A task is runnable if its document is either null or fully active.

[This section](https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-for-spec-authors) is also relevant.

So we should queue a task to update the state, it should check that the state is not already cancelled and react accordingly. We should probably use the network task source. I'm not quite sure which global object we should use but it can't be a document.


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

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

Received on Monday, 4 September 2023 05:11:58 UTC