Skip to content

Commit b53d3c2

Browse files
authored
feat: update appcenter config (microsoft#92041)
1 parent 3943d61 commit b53d3c2

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.43.0",
4-
"distro": "e16fca95fbe6abb7e846db3fd372c95da67a41ad",
4+
"distro": "d73d84e5b45a8d8918fcd372916b2d391bdd2c9e",
55
"author": {
66
"name": "Microsoft Corporation"
77
},

src/vs/platform/electron/electron-main/electronMainService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { dirExists } from 'vs/base/node/pfs';
2020
import { URI } from 'vs/base/common/uri';
2121
import { ITelemetryData, ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
2222
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
23+
import { ILogService } from 'vs/platform/log/common/log';
2324

2425
export interface IElectronMainService extends AddFirstParameterToFunctions<IElectronService, Promise<any> /* only methods, not events */, number | undefined /* window ID */> { }
2526

@@ -34,7 +35,8 @@ export class ElectronMainService implements IElectronMainService {
3435
@IDialogMainService private readonly dialogMainService: IDialogMainService,
3536
@ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
3637
@IEnvironmentService private readonly environmentService: IEnvironmentService,
37-
@ITelemetryService private readonly telemetryService: ITelemetryService
38+
@ITelemetryService private readonly telemetryService: ITelemetryService,
39+
@ILogService private readonly logService: ILogService
3840
) {
3941
}
4042

@@ -392,6 +394,7 @@ export class ElectronMainService implements IElectronMainService {
392394

393395
async startCrashReporter(windowId: number | undefined, options: CrashReporterStartOptions): Promise<void> {
394396
crashReporter.start(options);
397+
this.logService.trace('ElectronMainService#crashReporter', JSON.stringify(options));
395398
}
396399

397400
//#endregion

src/vs/platform/product/common/productService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export interface IProductConfiguration {
8989
readonly checksums?: { [path: string]: string; };
9090
readonly checksumFailMoreInfoUrl?: string;
9191

92-
readonly hockeyApp?: {
92+
readonly appCenter?: {
9393
readonly 'win32-ia32': string;
9494
readonly 'win32-x64': string;
9595
readonly 'linux-x64': string;

src/vs/workbench/electron-browser/window.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as nls from 'vs/nls';
77
import { URI } from 'vs/base/common/uri';
88
import * as errors from 'vs/base/common/errors';
9-
import { equals, deepClone, assign } from 'vs/base/common/objects';
9+
import { equals, deepClone } from 'vs/base/common/objects';
1010
import * as DOM from 'vs/base/browser/dom';
1111
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
1212
import { IAction } from 'vs/base/common/actions';
@@ -422,8 +422,8 @@ export class ElectronWindow extends Disposable {
422422
this.updateTouchbarMenu();
423423

424424
// Crash reporter (if enabled)
425-
if (!this.environmentService.disableCrashReporter && product.crashReporter && product.hockeyApp && this.configurationService.getValue('telemetry.enableCrashReporter')) {
426-
this.setupCrashReporter(product.crashReporter.companyName, product.crashReporter.productName, product.hockeyApp);
425+
if (!this.environmentService.disableCrashReporter && product.crashReporter && product.appCenter && this.configurationService.getValue('telemetry.enableCrashReporter')) {
426+
this.setupCrashReporter(product.crashReporter.companyName, product.crashReporter.productName, product.appCenter);
427427
}
428428
}
429429

@@ -536,26 +536,26 @@ export class ElectronWindow extends Disposable {
536536
}
537537
}
538538

539-
private async setupCrashReporter(companyName: string, productName: string, hockeyAppConfig: typeof product.hockeyApp): Promise<void> {
540-
if (!hockeyAppConfig) {
539+
private async setupCrashReporter(companyName: string, productName: string, appCenterConfig: typeof product.appCenter): Promise<void> {
540+
if (!appCenterConfig) {
541541
return;
542542
}
543543

544+
const appCenterURL = isWindows ? appCenterConfig[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64']
545+
: isLinux ? appCenterConfig[`linux-x64`] : appCenterConfig.darwin;
546+
const info = await this.telemetryService.getTelemetryInfo();
547+
544548
// base options with product info
545549
const options: CrashReporterStartOptions = {
546550
companyName,
547551
productName,
548-
submitURL: isWindows ? hockeyAppConfig[process.arch === 'ia32' ? 'win32-ia32' : 'win32-x64'] : isLinux ? hockeyAppConfig[`linux-x64`] : hockeyAppConfig.darwin,
552+
submitURL: appCenterURL.concat('&uid=', info.machineId, '&iid=', info.instanceId),
549553
extra: {
550554
vscode_version: product.version,
551555
vscode_commit: product.commit || ''
552556
}
553557
};
554558

555-
// mixin telemetry info
556-
const info = await this.telemetryService.getTelemetryInfo();
557-
assign(options.extra, { vscode_sessionId: info.sessionId });
558-
559559
// start crash reporter right here
560560
crashReporter.start(deepClone(options));
561561

0 commit comments

Comments
 (0)