WICG/pending-beacon

[Fetch-Based API] `SendSignal`

mingyc opened this issue · 5 comments

Context: #70 #71

This is to observe a event to tell if a deferSend request is still pending.

To prevent from data races, the underlying implementation should ensure that renderer is authoritative to the request's send state when it's alive. Similar to this discussion for PendingBeacon.

noamr commented

See [https://github.com//issues/70#issuecomment-1486404787]. I wonder if we need sentSignal, given a per-origin quota instead of a global quota for beacons.

noamr@ Could you tell why sentSignal is bound to request quota?

Another reason to have it (or pending state) is to tell if the request has been sent if it stays in BFCache for more than backgroundTimeout

noamr commented

noamr@ Could you tell why sentSignal is bound to request quota?

Another reason to have it (or pending state) is to tell if the request has been sent if it stays in BFCache for more than backgroundTimeout

If the document is in BFCache, how would you receive that promise? When you're restored from BFCache?

It can only be received and triggered after restored from BFCache. But at least users can know that their request has been sent.

mingyc commented

SendSignal is now the returned FetchLaterResult.activated field in fetchLater() API. See https://whatpr.org/fetch/1647.html#dom-fetchlaterresult-activated