提交 94c6d048 编写于 作者: R Rachel Macfarlane

Update browser telemetry common properties

上级 69f99d34
...@@ -93,14 +93,12 @@ export function PlatformToString(platform: Platform) { ...@@ -93,14 +93,12 @@ export function PlatformToString(platform: Platform) {
} }
let _platform: Platform = Platform.Web; let _platform: Platform = Platform.Web;
if (_isNative) { if (_isMacintosh) {
if (_isMacintosh) { _platform = Platform.Mac;
_platform = Platform.Mac; } else if (_isWindows) {
} else if (_isWindows) { _platform = Platform.Windows;
_platform = Platform.Windows; } else if (_isLinux) {
} else if (_isLinux) { _platform = Platform.Linux;
_platform = Platform.Linux;
}
} }
export const isWindows = _isWindows; export const isWindows = _isWindows;
......
...@@ -16,18 +16,19 @@ import { cleanRemoteAuthority } from 'vs/platform/telemetry/common/telemetryUtil ...@@ -16,18 +16,19 @@ import { cleanRemoteAuthority } from 'vs/platform/telemetry/common/telemetryUtil
export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, remoteAuthority?: string): Promise<{ [name: string]: string | undefined }> { export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, remoteAuthority?: string): Promise<{ [name: string]: string | undefined }> {
const result: { [name: string]: string | undefined; } = Object.create(null); const result: { [name: string]: string | undefined; } = Object.create(null);
const instanceId = storageService.get(instanceStorageKey, StorageScope.GLOBAL)!;
const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!; const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!;
const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!; const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!;
/**
* Note: In the web, session date information is fetched from browser storage, so these dates are tied to a specific
* browser and not the machine overall.
*/
// __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } // __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result['common.firstSessionDate'] = firstSessionDate; result['common.firstSessionDate'] = firstSessionDate;
// __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } // __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result['common.lastSessionDate'] = lastSessionDate || ''; result['common.lastSessionDate'] = lastSessionDate || '';
// __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } // __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result['common.isNewSession'] = !lastSessionDate ? '1' : '0'; result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
// __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result['common.instanceId'] = instanceId;
// __GDPR__COMMON__ "common.remoteAuthority" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" } // __GDPR__COMMON__ "common.remoteAuthority" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority); result['common.remoteAuthority'] = cleanRemoteAuthority(remoteAuthority);
......
...@@ -204,7 +204,7 @@ class CodeRendererMain extends Disposable { ...@@ -204,7 +204,7 @@ class CodeRendererMain extends Disposable {
version: '1.38.0-unknown', version: '1.38.0-unknown',
nameLong: 'Unknown', nameLong: 'Unknown',
extensionAllowedProposedApi: [], extensionAllowedProposedApi: [],
}, ...{ urlProtocol: '', enableTelemetry: false } }, ...{ urlProtocol: ''}
}; };
return { _serviceBrand: undefined, ...productConfiguration }; return { _serviceBrand: undefined, ...productConfiguration };
} }
......
...@@ -15,6 +15,7 @@ import { joinPath } from 'vs/base/common/resources'; ...@@ -15,6 +15,7 @@ import { joinPath } from 'vs/base/common/resources';
import { Schemas } from 'vs/base/common/network'; import { Schemas } from 'vs/base/common/network';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IWorkbenchConstructionOptions } from 'vs/workbench/workbench.web.api'; import { IWorkbenchConstructionOptions } from 'vs/workbench/workbench.web.api';
import { generateUuid } from 'vs/base/common/uuid';
export class BrowserWindowConfiguration implements IWindowConfiguration { export class BrowserWindowConfiguration implements IWindowConfiguration {
...@@ -80,6 +81,7 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment ...@@ -80,6 +81,7 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
this.appNameLong = 'Visual Studio Code - Web'; this.appNameLong = 'Visual Studio Code - Web';
this.configuration.remoteAuthority = options.remoteAuthority; this.configuration.remoteAuthority = options.remoteAuthority;
this.configuration.machineId = generateUuid();
this.userRoamingDataHome = URI.file('/User').with({ scheme: Schemas.userData }); this.userRoamingDataHome = URI.file('/User').with({ scheme: Schemas.userData });
this.settingsResource = joinPath(this.userRoamingDataHome, 'settings.json'); this.settingsResource = joinPath(this.userRoamingDataHome, 'settings.json');
this.keybindingsResource = joinPath(this.userRoamingDataHome, 'keybindings.json'); this.keybindingsResource = joinPath(this.userRoamingDataHome, 'keybindings.json');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册