Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report delivery - executing steps "asynchronously" and queueing tasks on which event loop? #235

Open
zcorpan opened this issue Feb 25, 2021 · 4 comments
Assignees

Comments

@zcorpan
Copy link
Member

zcorpan commented Feb 25, 2021

https://w3c.github.io/reporting/#send-reports says

(3.3.) For each (origin, per-origin reports) pair in origin map, execute the following steps asynchronously:

(3.3.1.) Let result be the result of executing § 3.5.2 Attempt to deliver reports to endpoint on endpoint, origin, and per-origin reports.

Should that say "in parallel" instead of "asynchronously"?

-> https://w3c.github.io/reporting/#try-delivery

(3.) Queue a task to fetch request.

Which event loop is that queued for? Since sending reports is arbitrarily delayed, the window or worker from which they originated could be long gone, and their event loop too. Or even if it's from a document that has been navigated away but is still in history, it's not active, so tasks won't run until it's navigated back and activated.

Which is to say, I'm not sure it works to queue a task here. Presumably you want the reports to be sent when the UA tries to send them, regardless of the state or the originating context.

Am I missing something? Do implementations queue a task here?

@clelland
Copy link
Contributor

See also #220 for the task queue question.

Some of the wording here comes from the previous version of this spec, where all reporting was out-of-band, and not tied to a particular window or worker. (That's still the case in the Chromium implementation, although that should change)

By the time we reach https://w3c.github.io/reporting/#send-reports, we have collected all of the reports which are going to be sent, and the UA should just send them. That should be done such that it doesn't block anything else, so I expected that queuing a task was still appropriate here.

@zcorpan
Copy link
Member Author

zcorpan commented Feb 25, 2021

If the steps are running in parallel, then they're not blocking other things.

@annevk is it OK to invoke "fetch" from in parallel steps?

@annevk
Copy link
Member

annevk commented Feb 26, 2021

Where does it go in parallel? If these steps are synchronous, no need to queue a task to fetch. And fetch can be used while in parallel in theory, but that's not fully worked out yet with respect to some global state grabbing it does early on.

@annevk
Copy link
Member

annevk commented Feb 26, 2021

Oh I see, "asynchronously". I think it's easier to use the "main thread" version of fetch here, along with its new callback arguments.

@clelland clelland self-assigned this Jun 20, 2022
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

No branches or pull requests

3 participants