Skip to content

Commit

Permalink
Disabled telemetry.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyanziano committed Mar 14, 2019
1 parent 3ad8b8c commit df3a3f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/app/main/src/telemetry/telemetryService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ describe('TelemetryService', () => {
expect(mockAITrackEvent).not.toHaveBeenCalled();
});

// NOTE: Disabled for v4.3
/*
it('should track events', () => {
const mockStartup = jest.fn(() => null);
(TelemetryService as any).startup = mockStartup;
Expand All @@ -145,4 +147,5 @@ describe('TelemetryService', () => {
properties: { some: 'property' },
});
});
*/
});
11 changes: 10 additions & 1 deletion packages/app/main/src/telemetry/telemetryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ export class TelemetryService {
private static _client: AppInsights.TelemetryClient;
private static _hasStarted: boolean = false;

public static trackEvent(..._args: any[]): void {
// no-op until telemetry is re-enabled
if (this._client || this.enabled || this.startup) {
return;
}
}

// NOTE: Disabled for v4.3
/*
public static trackEvent(name: string, properties?: { [key: string]: any }): void {
if (!this.enabled || !name) {
return;
Expand All @@ -55,7 +64,7 @@ export class TelemetryService {
// swallow the exception; we don't want to crash the app
// on a failed attempt to collect usage data
}
}
}*/

private static get enabled(): boolean {
const settings: SettingsImpl = getSettings() || ({} as SettingsImpl);
Expand Down

0 comments on commit df3a3f6

Please # to comment.