(core) Renaming installationId metadata for checkUpdateAPI telemetry endpoint.

Summary:
CheckUpdateAPI is now storing client's installation id in a new field called 'deploymentId'.
Previously it was using installationId which is reserved (and overriden) by the home server.

Test Plan: Existing and manual

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D4268
pull/1039/head
Jarosław Sadziński 3 months ago
parent f071d91a0a
commit 98176132b0

@ -1746,7 +1746,7 @@ export const TelemetryContracts: TelemetryContracts = {
minimumTelemetryLevel: Level.limited,
retentionPeriod: 'indefinitely',
metadataContracts: {
installationId: {
deploymentId: {
description: 'The installation id of the client.',
dataType: 'string',
},

@ -334,6 +334,17 @@ export class Telemetry implements ITelemetry {
try {
this._numPendingForwardEventRequests += 1;
const {category: eventCategory} = TelemetryContracts[event];
if (metadata) {
if ('installationId' in metadata ||
'eventSource' in metadata ||
'eventName' in metadata ||
'eventCategory' in metadata)
{
throw new Error('metadata contains reserved keys');
}
}
await this._doForwardEvent(JSON.stringify({
event,
metadata: {

@ -86,7 +86,7 @@ export class UpdateManager {
// This is the most interesting part for us, to track installation ids and match them
// with the version of the client. Won't be send without telemetry opt in.
const installationId = optStringParam(
const deploymentId = optStringParam(
payload("installationId"),
"installationId"
);
@ -104,8 +104,8 @@ export class UpdateManager {
.getTelemetry()
.logEvent(req as RequestWithLogin, "checkedUpdateAPI", {
full: {
installationId,
deploymentType,
deploymentId,
deploymentType
},
});

Loading…
Cancel
Save