From edeca0d80c1a6fc975a87ba71ee6f01e091a576b Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Tue, 27 Aug 2024 16:30:27 +0200 Subject: [PATCH] fix check --- .../compass-telemetry/src/telemetry-events.ts | 44 +++++++++++++++---- .../compass/src/main/auto-update-manager.ts | 12 +++-- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/packages/compass-telemetry/src/telemetry-events.ts b/packages/compass-telemetry/src/telemetry-events.ts index 0c59b7efbc6..0668a7fd5da 100644 --- a/packages/compass-telemetry/src/telemetry-events.ts +++ b/packages/compass-telemetry/src/telemetry-events.ts @@ -1213,8 +1213,37 @@ type AutoupdateAcceptedEvent = { }; }; +/** This event is fired when the user accepts to restart the application from + * the update popup. + * + * @category Autoupdates + */ +type ApplicationRestartAcceptedEvent = { + name: 'Application Restart Accepted'; + payload: Record; +}; + +/** This event is fired when the auto-update feature is enabled. + * + * @category Autoupdates + */ +type AutoupdateEnabledEvent = { + name: 'Autoupdate Enabled'; + payload: Record; +}; + +/** This event is fired when the auto-update feature is disabled. + * + * @category Autoupdates + */ +type AutoupdateDisabledEvent = { + name: 'Autoupdate Disabled'; + payload: Record; +}; + /** - * This event is fired when "Update available" popup is shown and user rejects the update. + * This event is fired when "Update available" popup is shown and user rejects + * the update. * * @category Autoupdates */ @@ -1224,7 +1253,7 @@ type AutoupdateDismissedEvent = { }; /** - * This event is fired when user changes items view type betweet list and grid + * This event is fired when user changes items view type between list and grid. * * @category Database / Collection List */ @@ -1402,9 +1431,7 @@ type ScreenEvent = ConnectionScoped<{ */ type PerformanceAdvisorClickedEvent = ConnectionScoped<{ name: 'Performance Advisor Clicked'; - payload: { - // - }; + payload: Record; }>; /** @@ -1415,9 +1442,7 @@ type PerformanceAdvisorClickedEvent = ConnectionScoped<{ */ type SecretStorageNotAvailable = { name: 'Secret Storage Not Available'; - payload: { - // - }; + payload: Record; }; export type TelemetryEvent = @@ -1447,6 +1472,9 @@ export type TelemetryEvent = | AtlasSignOutEvent | AutoupdateAcceptedEvent | AutoupdateDismissedEvent + | ApplicationRestartAcceptedEvent + | AutoupdateEnabledEvent + | AutoupdateDisabledEvent | BulkDeleteExecutedEvent | BulkDeleteOpenedEvent | BulkUpdateExecutedEvent diff --git a/packages/compass/src/main/auto-update-manager.ts b/packages/compass/src/main/auto-update-manager.ts index 1c4f19bd523..7dbdf8c7fa4 100644 --- a/packages/compass/src/main/auto-update-manager.ts +++ b/packages/compass/src/main/auto-update-manager.ts @@ -493,7 +493,9 @@ const STATE_UPDATE: Record< this.maybeInterrupt(); - track('Application Restart Accepted'); + track('Application Restart Accepted', { + // + }); this.maybeInterrupt(); @@ -801,12 +803,16 @@ class CompassAutoUpdateManager { ); if (enabled) { - track('Autoupdate Enabled'); + track('Autoupdate Enabled', { + // + }); this.setState( AutoUpdateManagerState.CheckingForUpdatesForAutomaticCheck ); } else { - track('Autoupdate Disabled'); + track('Autoupdate Disabled', { + // + }); this.setState(AutoUpdateManagerState.Disabled); } });