Closed Bug 1867821 Opened 1 year ago Closed 1 year ago

Implement automatic fallback from `sendBeacon` to `fetch` in glean.js

Categories

(Data Platform and Tools :: Glean: SDK, task, P1)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Dexter, Assigned: janerik, Mentored)

References

Details

Attachments

(1 file)

We now have a sendBeacon uploader for glean.js. However, on some browsers, sendBeacon might not be available. We need to tweak the provider to fall back to fetch if needed or create a new uploader to experiment with that.

After this is done, we can turn this on by default in glean.js while still offering users a way to switch back to the fetch one.

Depends on: 1777182
Assignee: nobody → brosa

For additional context:

This was implemented this way so that we could test things without breaking the original implementation. We want to always use sendBeacon unless the client explicitly chooses to use fetch. This should be something that is able to be set in the initialize config object.

Our docs should also reflect that by default everyone should be using sendBeacon unless they have a specific reason not to. The reason for sendBeacon was to fix data loss issues caused by page unloads with fetch in Firefox.

Feel free to reach out with any questions about the implementation itself, happy to help.

Assignee: brosa → nobody
Mentor: brosa
Priority: -- → P3

I'll take this.

Assignee: nobody → jrediger
Priority: P3 → P1
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Blocks: 1878263
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: