From e46341ac46797c604f8864819825ec99c4c10725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 23 Jul 2024 16:42:25 +0200 Subject: [PATCH] refactor(core): Remove unused telemetry payload (no-changelog) (#10158) --- .../src/environments/variables/variables.service.ee.ts | 2 +- packages/cli/src/eventbus/event.service.ts | 2 +- packages/cli/src/eventbus/event.types.ts | 4 +--- .../cli/src/telemetry/telemetry-event-relay.service.ts | 10 +++------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/cli/src/environments/variables/variables.service.ee.ts b/packages/cli/src/environments/variables/variables.service.ee.ts index 2db892bca8..94233da065 100644 --- a/packages/cli/src/environments/variables/variables.service.ee.ts +++ b/packages/cli/src/environments/variables/variables.service.ee.ts @@ -71,7 +71,7 @@ export class VariablesService { } this.validateVariable(variable); - this.eventService.emit('variable-created', { variableType: variable.type }); + this.eventService.emit('variable-created'); const saveResult = await this.variablesRepository.save( { ...variable, diff --git a/packages/cli/src/eventbus/event.service.ts b/packages/cli/src/eventbus/event.service.ts index 0506305df8..2df51af22c 100644 --- a/packages/cli/src/eventbus/event.service.ts +++ b/packages/cli/src/eventbus/event.service.ts @@ -4,7 +4,7 @@ import type { Event } from './event.types'; @Service() export class EventService extends EventEmitter { - emit(eventName: K, arg: Event[K]) { + emit(eventName: K, arg?: Event[K]) { super.emit(eventName, arg); return true; } diff --git a/packages/cli/src/eventbus/event.types.ts b/packages/cli/src/eventbus/event.types.ts index 733144a596..a0104aee5b 100644 --- a/packages/cli/src/eventbus/event.types.ts +++ b/packages/cli/src/eventbus/event.types.ts @@ -256,9 +256,7 @@ export type Event = { success: boolean; }; - 'variable-created': { - variableType: string; - }; + 'variable-created': {}; 'external-secrets-provider-settings-saved': { userId?: string; diff --git a/packages/cli/src/telemetry/telemetry-event-relay.service.ts b/packages/cli/src/telemetry/telemetry-event-relay.service.ts index 9517ec20b1..a47dd209d7 100644 --- a/packages/cli/src/telemetry/telemetry-event-relay.service.ts +++ b/packages/cli/src/telemetry/telemetry-event-relay.service.ts @@ -44,9 +44,7 @@ export class TelemetryEventRelay { this.eventService.on('license-renewal-attempted', (event) => { this.licenseRenewalAttempted(event); }); - this.eventService.on('variable-created', (event) => { - this.variableCreated(event); - }); + this.eventService.on('variable-created', () => this.variableCreated()); this.eventService.on('external-secrets-provider-settings-saved', (event) => { this.externalSecretsProviderSettingsSaved(event); }); @@ -187,10 +185,8 @@ export class TelemetryEventRelay { }); } - private variableCreated({ variableType }: Event['variable-created']) { - void this.telemetry.track('User created variable', { - variable_type: variableType, - }); + private variableCreated() { + void this.telemetry.track('User created variable'); } private externalSecretsProviderSettingsSaved({