-
Notifications
You must be signed in to change notification settings - Fork 3
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
test: Test reliability of navigator.sendBeacon() #888
Conversation
🚀 @guardian/commercial-v7.1.1-beta.2 published to npm as a beta release |
aff5ede
to
ff8b753
Compare
🚀 @guardian/commercial-v7.1.1-beta.3 published to npm as a beta release |
Hmm the beta labelling should be v8.x-beta.x 🤔 |
🚀 @guardian/commercial-v7.1.1-beta.4 published to npm as a beta release |
Yes I noticed this too! I tried running the grep statement locally that the beta release code uses, and it seems to think the latest version is the beta release from your bundle + core merge PR and it's incrementing from that. It doesn't seem to be able to pick up the v8 release? |
f8dfe00
to
d6d9ba5
Compare
Thanks for the fix :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if we are capturing or able to join browser data later as this might be useful to @guardian/open-journalism @mxdvl and their investigation of holes in CWV collection.
I doubt the issue is with the mechanism for sending data over the wire, as we still get a lot information for TTFB and LCP. |
|
d27dd8f
to
643cc27
Compare
🚀 @guardian/commercial-v8.0.2-beta.1 published to npm as a beta release |
37b1f3f
to
e309191
Compare
e309191
to
8f6c1c3
Compare
🎉 This PR is included in version 9.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* Send beacon and fetch event at sampling rate of 5% * Add sampling rate parameter * Set test sample rate to zero to fix failing tests * Fix property addition and increase sampling * Get the sendBeacon test logs reliably firing * Add amiused to page targeting to create test logs * Set all amiused.spec beacon test sampling to 0 * Update beta release to find latest beta version * Set sampling to 1% * Remove testing function * Undo beta release workflow command change
What does this change?
For 1% of calls to amiused, send a fetch keepalive = true POST request as well as navigator.sendBeacon() for amiused logging. Each will be labelled so that we can query the data for these specific test calls. Keeping the sampling percent low to start so we don't crowd the logs too much, and we can always increase later on if not enough data is coming through.
Why?
This will allow us to compare the number of logs received for each send method, giving us an idea of how reliable navigator.sendBeacon() is compared to sending a fetch request. Some articles online suggest that navigator.sendBeacon() may not be as reliable as we think: https://volument.com/blog/sendbeacon-is-broken