in glean/src/core/internal_metrics.ts [220:243]
private initializeClientId(): void {
let needNewClientId = false;
const clientIdData = Context.metricsDatabase.getMetric(
CLIENT_INFO_STORAGE,
this.clientId
);
if (clientIdData) {
try {
const currentClientId = createMetric("uuid", clientIdData);
if (currentClientId.payload() === KNOWN_CLIENT_ID) {
needNewClientId = true;
}
} catch {
log(LOG_TAG, "Unexpected value found for Glean clientId. Ignoring.", LoggingLevel.Warn);
needNewClientId = true;
}
} else {
needNewClientId = true;
}
if (needNewClientId) {
this.clientId.set(generateUUIDv4());
}
}