WICG / pending-beacon

A better beaconing API
Other
43 stars 8 forks source link

Scoping confusion #64

Closed annevk closed 9 months ago

annevk commented 1 year ago

Early in the document you say it's scoped to a document, but then elsewhere you do

Insert beacon into the user agent’s pending beacon set.

mingyc commented 1 year ago

Spec is outdated compared to latest explainer.

Note: quote is from https://wicg.github.io/pending-beacon/#pendingbeacon-interface

clelland commented 1 year ago

I originally wrote that as I expected that, while the beacon data is associated with a specific document, it needs to be owned by the UA so that it can continue to exist (and be sent) when the document is destroyed. So the conceptual model is that the UA has set of beacons, and knows what documents each is associated with, and decides when to send them.

annevk commented 1 year ago

How can it know about the document if the document is destroyed? That doesn't quite add up. You'd need to associate a bunch of state explicitly with it.

mingyc commented 9 months ago

Clarification and subsequent works have been addressed as fetchLater() API in https://github.com/whatwg/fetch/pull/1647 and https://github.com/whatwg/fetch/issues/1715.