Closed Bug 1494896 Opened Last year Closed Last year

Make HCT library reject on init timeout


(Toolkit :: Telemetry, enhancement, P1)




Tracking Status
firefox64 --- fixed


(Reporter: Dexter, Assigned: Dexter)


(Blocks 2 open bugs)



(1 file)

In bug 1490284 we introduced a mechanism for which the HCT library rejects if the requesting website has not enough privileges or telemetry is disabled. Unfortunately, this required a change in chrome JSMs and is not available to older versions of Firefox.

A potential hackish workaround, suggested in bug 1490284 comment 17, is:

> Ok. I'm just wondering if there's some we can fix either in the lib on our
> side so that the Promise rejects if HCT is not enabled even if the Firefox
> code isn't there. Maybe using Promise.race() with a second function that
> runs a timeout with a rejection could ensure that the promise always rejects
> in lieu of the proper implementation. Not sure if that's something that
> should be done inside the lib or in our implementation? It feels like a bit
> of a hack but then leaving an promise unresolved/unrejected on older
> browsers is not ideal.

This bug is about implementing that workaround or another one, if some better solution can be found.
Depends on: 1490284
Blocks: 1416718
Points: --- → 2
Priority: -- → P1
Assignee: nobody → alessio.placitelli
This patch enables the HCT init promise to reject even for Firefox
versions (before 63) that do not have the required chrome code
to communicate back to the library the lack of privileges or that
HCT is disabled. It introduces a timeout that rejects the promise
after 3 seconds.
Pushed by
Make hybrid content telemetry init reject on older versions of Frefox. r=chutten
Blocks: 1497138
Blocks: 1497139
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.