Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasimir committed Aug 27, 2024
1 parent c988743 commit edeca0d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 11 deletions.
44 changes: 36 additions & 8 deletions packages/compass-telemetry/src/telemetry-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, never>;
};

/** This event is fired when the auto-update feature is enabled.
*
* @category Autoupdates
*/
type AutoupdateEnabledEvent = {
name: 'Autoupdate Enabled';
payload: Record<string, never>;
};

/** This event is fired when the auto-update feature is disabled.
*
* @category Autoupdates
*/
type AutoupdateDisabledEvent = {
name: 'Autoupdate Disabled';
payload: Record<string, never>;
};

/**
* 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
*/
Expand All @@ -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
*/
Expand Down Expand Up @@ -1402,9 +1431,7 @@ type ScreenEvent = ConnectionScoped<{
*/
type PerformanceAdvisorClickedEvent = ConnectionScoped<{
name: 'Performance Advisor Clicked';
payload: {
//
};
payload: Record<string, never>;
}>;

/**
Expand All @@ -1415,9 +1442,7 @@ type PerformanceAdvisorClickedEvent = ConnectionScoped<{
*/
type SecretStorageNotAvailable = {
name: 'Secret Storage Not Available';
payload: {
//
};
payload: Record<string, never>;
};

export type TelemetryEvent =
Expand Down Expand Up @@ -1447,6 +1472,9 @@ export type TelemetryEvent =
| AtlasSignOutEvent
| AutoupdateAcceptedEvent
| AutoupdateDismissedEvent
| ApplicationRestartAcceptedEvent
| AutoupdateEnabledEvent
| AutoupdateDisabledEvent
| BulkDeleteExecutedEvent
| BulkDeleteOpenedEvent
| BulkUpdateExecutedEvent
Expand Down
12 changes: 9 additions & 3 deletions packages/compass/src/main/auto-update-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,9 @@ const STATE_UPDATE: Record<

this.maybeInterrupt();

track('Application Restart Accepted');
track('Application Restart Accepted', {
//
});

this.maybeInterrupt();

Expand Down Expand Up @@ -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);
}
});
Expand Down

0 comments on commit edeca0d

Please sign in to comment.