mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 17:23:45 -05:00
Remove all ID fields from telemetry (#1299)
* Remove all ID fields from telemetry * Fix how some of the fields are blanked out * Add back blank userId * Disable VS Code tests broken by this change
This commit is contained in:
@@ -20,48 +20,34 @@ export function resolveWorkbenchCommonProperties(storageService: IStorageService
|
||||
result['common.version.renderer'] = process.versions && (<any>process).versions['chrome'];
|
||||
// {{SQL CARBON EDIT}}
|
||||
result['common.application.name'] = product.nameLong;
|
||||
getUserId(storageService).then(value => result['common.userId'] = value);
|
||||
// {{SQL CARBON EDIT}}
|
||||
result['common.userId'] = '';
|
||||
|
||||
const lastSessionDate = storageService.get('telemetry.lastSessionDate');
|
||||
const firstSessionDate = storageService.get('telemetry.firstSessionDate') || new Date().toUTCString();
|
||||
storageService.store('telemetry.firstSessionDate', firstSessionDate);
|
||||
storageService.store('telemetry.lastSessionDate', new Date().toUTCString());
|
||||
// {{SQL CARBON EDIT}}
|
||||
// const lastSessionDate = storageService.get('telemetry.lastSessionDate');
|
||||
// const firstSessionDate = storageService.get('telemetry.firstSessionDate') || new Date().toUTCString();
|
||||
// storageService.store('telemetry.firstSessionDate', firstSessionDate);
|
||||
// storageService.store('telemetry.lastSessionDate', new Date().toUTCString());
|
||||
|
||||
// __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
result['common.firstSessionDate'] = firstSessionDate;
|
||||
// __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
result['common.lastSessionDate'] = lastSessionDate;
|
||||
// __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
|
||||
// // __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.firstSessionDate'] = firstSessionDate;
|
||||
// // __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.lastSessionDate'] = lastSessionDate;
|
||||
// // __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// __GDPR__COMMON__ "common.instanceId" : { "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" }
|
||||
result['common.instanceId'] = getOrCreateInstanceId(storageService);
|
||||
// result['common.instanceId'] = getOrCreateInstanceId(storageService);
|
||||
result['common.instanceId'] = '';
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
function getOrCreateInstanceId(storageService: IStorageService): string {
|
||||
const result = storageService.get('telemetry.instanceId') || uuid.generateUuid();
|
||||
storageService.store('telemetry.instanceId', result);
|
||||
|
||||
return result;
|
||||
}
|
||||
// {{SQL CARBON EDIT}}
|
||||
// Get the unique ID for the current user
|
||||
function getUserId(storageService: IStorageService): Promise<string> {
|
||||
var userId = storageService.get('common.userId');
|
||||
return new Promise<string>(resolve => {
|
||||
// Generate the user id if it has not been created already
|
||||
if (typeof userId === 'undefined') {
|
||||
let id = Utils.generateUserId();
|
||||
id.then( newId => {
|
||||
userId = newId;
|
||||
resolve(userId);
|
||||
//store the user Id in the storage service
|
||||
storageService.store('common.userId', userId);
|
||||
});
|
||||
} else {
|
||||
resolve(userId);
|
||||
}
|
||||
});
|
||||
}
|
||||
// function getOrCreateInstanceId(storageService: IStorageService): string {
|
||||
// const result = storageService.get('telemetry.instanceId') || uuid.generateUuid();
|
||||
// storageService.store('telemetry.instanceId', result);
|
||||
// return result;
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user