Closed Bug 1494896 Opened Last year Closed Last year
Make HCT library reject on init timeout
46 bytes, text/x-phabricator-request
|Details | Review|
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.
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 firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/6a61b59ee993 Make hybrid content telemetry init reject on older versions of Frefox. r=chutten
You need to log in before you can comment on or make changes to this bug.