Bug 1522381 - don't rely on Services.startup.getStartupInfo().main for telemetry session start. r=tcsc

Differential Revision: https://phabricator.services.mozilla.com/D19098

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Hammond 2019-02-08 01:49:33 +00:00
Родитель 247022a791
Коммит 4972aa12a6
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -477,7 +477,12 @@ class SyncTelemetryImpl {
this.lastSubmissionTime = Telemetry.msSinceProcessStart();
this.lastUID = EMPTY_UID;
this.lastDeviceID = undefined;
let sessionStartDate = Services.startup.getStartupInfo().main;
// Note that the sessionStartDate is somewhat arbitrary - the telemetry
// modules themselves just use `new Date()`. This means that our startDate
// isn't going to be the same as the sessionStartDate in the main pings,
// but that's OK for now - if it's a problem we'd need to change the
// telemetry modules to expose what it thinks the sessionStartDate is.
let sessionStartDate = new Date();
this.sessionStartDate = TelemetryUtils.toLocalTimeISOString(
TelemetryUtils.truncateToHours(sessionStartDate));
}