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

When the user agent sends data should be clarified #7

Closed
yutakahirano opened this issue Jul 5, 2022 · 2 comments
Closed

When the user agent sends data should be clarified #7

yutakahirano opened this issue Jul 5, 2022 · 2 comments
Labels
api Issue with API specs question Further information is requested

Comments

@yutakahirano
Copy link

I read the README.md and the design doc but it is still unclear to me when the user agent sends data and when it doesn't.

In the design doc, I found this paragraph.

In the usual case, the ultimate triggering of the beacon send will be a page lifetime event, such as the page being evicted from the BFCache, or the page’s visibility changing. At this time the PendingBeaconHost will indicate to the PendingBeaconNetworkService which beacons need to be sent.

Does this mean the user agent never starts sending beacons without page lifecycle events (and sendNow calls)? The description sounds weaker though (it sounds like there are some exceptions), so I want to make sure.

This is very important so I want to make sure before we start implementing property setters.

@mingyc mingyc added question Further information is requested api Issue with API specs labels Jul 6, 2022
@fergald
Copy link
Collaborator

fergald commented Jul 19, 2022

From #13 it seems at least some of the time it will trigger from a timeout. Unclear as yet whether that timeout could occur while the document is active.

@mingyc
Copy link
Collaborator

mingyc commented Sep 12, 2022

In the latest explainer, a PendingBeacon gets sent in one of the following scenario:

  1. By Renderer
    1. When JavaScript executes PendingBeacon.sendNow()
    2. When a PendingBeacon's timer of timeout property ends.
    3. When the document (where the PendingBeacon was created) enters hidden .visibility state, the renderer will sends out every PendingBeacon it has according to individual PendingBeacon's backgroundTimeout property.
  2. By Browser
    1. When the document is discarded or deleted, the browser process should send out all queued beacons created on that document.
    2. When the associated document's renderer process crashes, the browser process should send out all queued beacon.
    3. When the document is navigated away, on transitioning to pagehide state, the browser process should send out all queued beacons from the document. (Neccessary for [Privacy] Address privacy requirement around "network changes" #30)

For 2-1 and 2-2, the beacon object in the renderer won't know whether itself is sent or not, but it's not relevant as the document/renderer is already gone.

For 2-3, the state of the beacon object in the renderer needs to be updated.

@mingyc mingyc closed this as completed Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue with API specs question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants