From a0aff35d521aa4313298277a81a6d07decb8d45e Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 17 Jan 2025 15:08:08 +0100 Subject: [PATCH 1/2] delete unwanted telemetry events --- .../sharedProcess/sharedProcessMain.ts | 19 ------------ .../common/extensionsProfileScannerService.ts | 17 +++-------- .../browser/indexedDBFileSystemProvider.ts | 17 ----------- .../common/abstractSynchronizer.ts | 8 ----- .../common/userDataAutoSyncService.ts | 22 -------------- .../common/userDataSyncEnablementService.ts | 9 ------ src/vs/workbench/browser/web.main.ts | 10 +------ .../extensionRecommendationsService.ts | 15 ---------- .../extensions/browser/extensionsWidgets.ts | 11 ------- .../browser/extensionsWorkbenchService.ts | 29 +------------------ .../preferences/browser/settingsEditor2.ts | 4 --- .../browser/telemetry.contribution.ts | 26 ----------------- .../browser/userDataProfilesEditorModel.ts | 2 -- .../userDataSync/browser/userDataSync.ts | 2 -- .../extensions/browser/extensionUrlHandler.ts | 15 ---------- .../nativeExtensionService.ts | 13 --------- .../browser/userDataProfileManagement.ts | 17 ----------- .../browser/userDataSyncWorkbenchService.ts | 3 -- 18 files changed, 6 insertions(+), 233 deletions(-) diff --git a/src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts index 98824d792188d..fbbae411cdb0f 100644 --- a/src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts @@ -162,7 +162,6 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter { instantiationService.invokeFunction(accessor => { const logService = accessor.get(ILogService); const telemetryService = accessor.get(ITelemetryService); - const userDataProfilesService = accessor.get(IUserDataProfilesService); // Log info logService.trace('sharedProcess configuration', JSON.stringify(this.configuration)); @@ -173,10 +172,6 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter { // Error handler this.registerErrorHandler(logService); - // Report Profiles Info - this.reportProfilesInfo(telemetryService, userDataProfilesService); - this._register(userDataProfilesService.onDidChangeProfiles(() => this.reportProfilesInfo(telemetryService, userDataProfilesService))); - // Report Client OS/DE Info this.reportClientOSInfo(telemetryService, logService); }); @@ -455,20 +450,6 @@ class SharedProcessMain extends Disposable implements IClientConnectionFilter { }); } - private reportProfilesInfo(telemetryService: ITelemetryService, userDataProfilesService: IUserDataProfilesService): void { - type ProfilesInfoClassification = { - owner: 'sandy081'; - comment: 'Report profiles information'; - count: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Number of profiles' }; - }; - type ProfilesInfoEvent = { - count: number; - }; - telemetryService.publicLog2('profilesInfo', { - count: userDataProfilesService.profiles.length - }); - } - private async reportClientOSInfo(telemetryService: ITelemetryService, logService: ILogService): Promise { if (isLinux) { const [releaseInfo, displayProtocol] = await Promise.all([ diff --git a/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts b/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts index 162f11b5c968f..c0eefb920636b 100644 --- a/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts +++ b/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts @@ -19,7 +19,6 @@ import { IUserDataProfilesService } from '../../userDataProfile/common/userDataP import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; import { Mutable, isObject, isString, isUndefined } from '../../../base/common/types.js'; import { getErrorMessage } from '../../../base/common/errors.js'; -import { ITelemetryService } from '../../telemetry/common/telemetry.js'; interface IStoredProfileExtension { identifier: IExtensionIdentifier; @@ -110,7 +109,6 @@ export abstract class AbstractExtensionsProfileScannerService extends Disposable @IFileService private readonly fileService: IFileService, @IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService, @IUriIdentityService private readonly uriIdentityService: IUriIdentityService, - @ITelemetryService private readonly telemetryService: ITelemetryService, @ILogService private readonly logService: ILogService, ) { super(); @@ -244,13 +242,13 @@ export abstract class AbstractExtensionsProfileScannerService extends Disposable } if (storedProfileExtensions) { if (!Array.isArray(storedProfileExtensions)) { - this.reportAndThrowInvalidConentError(file); + this.throwInvalidConentError(file); } // TODO @sandy081: Remove this migration after couple of releases let migrate = false; for (const e of storedProfileExtensions) { if (!isStoredProfileExtension(e)) { - this.reportAndThrowInvalidConentError(file); + this.throwInvalidConentError(file); } let location: URI; if (isString(e.relativeLocation) && e.relativeLocation) { @@ -302,15 +300,8 @@ export abstract class AbstractExtensionsProfileScannerService extends Disposable }); } - private reportAndThrowInvalidConentError(file: URI): void { - type ErrorClassification = { - owner: 'sandy081'; - comment: 'Information about the error that occurred while scanning'; - code: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'error code' }; - }; - const error = new ExtensionsProfileScanningError(`Invalid extensions content in ${file.toString()}`, ExtensionsProfileScanningErrorCode.ERROR_INVALID_CONTENT); - this.telemetryService.publicLogError2<{ code: string }, ErrorClassification>('extensionsProfileScanningError', { code: error.code }); - throw error; + private throwInvalidConentError(file: URI): void { + throw new ExtensionsProfileScanningError(`Invalid extensions content in ${file.toString()}`, ExtensionsProfileScanningErrorCode.ERROR_INVALID_CONTENT); } private toRelativePath(extensionLocation: URI): string | undefined { diff --git a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts index d2b0da2e857a1..67c6b1e919241 100644 --- a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts +++ b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts @@ -15,20 +15,6 @@ import { createFileSystemProviderError, FileChangeType, IFileDeleteOptions, IFil import { DBClosedError, IndexedDB } from '../../../base/browser/indexedDB.js'; import { BroadcastDataChannel } from '../../../base/browser/broadcast.js'; -export type IndexedDBFileSystemProviderErrorDataClassification = { - owner: 'sandy081'; - comment: 'Information about errors that occur in the IndexedDB file system provider'; - readonly scheme: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'IndexedDB file system provider scheme for which this error occurred' }; - readonly operation: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'operation during which this error occurred' }; - readonly code: { classification: 'SystemMetaData'; purpose: 'PerformanceAndHealth'; comment: 'error code' }; -}; - -export type IndexedDBFileSystemProviderErrorData = { - readonly scheme: string; - readonly operation: string; - readonly code: string; -}; - // Standard FS Errors (expected to be thrown in production when invalid FS operations are requested) const ERR_FILE_NOT_FOUND = createFileSystemProviderError(localize('fileNotExists', "File does not exist"), FileSystemProviderErrorCode.FileNotFound); const ERR_FILE_IS_DIR = createFileSystemProviderError(localize('fileIsDirectory', "File is Directory"), FileSystemProviderErrorCode.FileIsADirectory); @@ -179,9 +165,6 @@ export class IndexedDBFileSystemProvider extends Disposable implements IFileSyst private readonly _onDidChangeFile = this._register(new Emitter()); readonly onDidChangeFile: Event = this._onDidChangeFile.event; - private readonly _onReportError = this._register(new Emitter()); - readonly onReportError = this._onReportError.event; - private readonly mtimes = new Map(); private cachedFiletree: Promise | undefined; diff --git a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts index 11c0315468aa1..54408a57abae2 100644 --- a/src/vs/platform/userDataSync/common/abstractSynchronizer.ts +++ b/src/vs/platform/userDataSync/common/abstractSynchronizer.ts @@ -36,12 +36,6 @@ import { } from './userDataSync.js'; import { IUserDataProfile, IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; -type IncompatibleSyncSourceClassification = { - owner: 'sandy081'; - comment: 'Information about the sync resource that is incompatible'; - source: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'settings sync resource. eg., settings, keybindings...' }; -}; - export function isRemoteUserData(thing: any): thing is IRemoteUserData { if (thing && (thing.ref !== undefined && typeof thing.ref === 'string' && thing.ref !== '') @@ -325,8 +319,6 @@ export abstract class AbstractSynchroniser extends Disposable implements IUserDa private async performSync(remoteUserData: IRemoteUserData, lastSyncUserData: IRemoteUserData | null, strategy: SyncStrategy, userDataSyncConfiguration: IUserDataSyncConfiguration): Promise { if (remoteUserData.syncData && remoteUserData.syncData.version > this.version) { - // current version is not compatible with cloud version - this.telemetryService.publicLog2<{ source: string }, IncompatibleSyncSourceClassification>('sync/incompatible', { source: this.resource }); throw new UserDataSyncError(localize({ key: 'incompatible', comment: ['This is an error while syncing a resource that its local version is not compatible with its remote version.'] }, "Cannot sync {0} as its local version {1} is not compatible with its remote version {2}", this.resource, this.version, remoteUserData.syncData.version), UserDataSyncErrorCode.IncompatibleLocalContent, this.resource); } diff --git a/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts index f868cccd7e3bd..5ab5b3dd21d52 100644 --- a/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts +++ b/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts @@ -21,20 +21,6 @@ import { IUserDataSyncTask, IUserDataAutoSyncService, IUserDataManifest, IUserDa import { IUserDataSyncAccountService } from './userDataSyncAccount.js'; import { IUserDataSyncMachinesService } from './userDataSyncMachines.js'; -type AutoSyncClassification = { - owner: 'sandy081'; - comment: 'Information about the sources triggering auto sync'; - sources: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Source that triggered auto sync' }; - providerId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Auth provider id used for sync' }; -}; - -type AutoSyncErrorClassification = { - owner: 'sandy081'; - comment: 'Information about the error that causes auto sync to fail'; - code: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'error code' }; - service: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Settings sync service for which this error has occurred' }; -}; - const disableMachineEventuallyKey = 'sync.disableMachineEventually'; const sessionIdKey = 'sync.sessionId'; const storeUrlKey = 'sync.storeUrl'; @@ -199,7 +185,6 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto // Reset if (everywhere) { - this.telemetryService.publicLog2<{}, { owner: 'sandy081'; comment: 'Reporting when settings sync is turned off in all devices' }>('sync/turnOffEveryWhere'); await this.userDataSyncService.reset(); } else { await this.userDataSyncService.resetLocal(); @@ -235,11 +220,6 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto // Error while syncing const userDataSyncError = UserDataSyncError.toUserDataSyncError(error); - // Log to telemetry - if (userDataSyncError instanceof UserDataAutoSyncError) { - this.telemetryService.publicLog2<{ code: string; service: string }, AutoSyncErrorClassification>(`autosync/error`, { code: userDataSyncError.code, service: this.userDataSyncStoreManagementService.userDataSyncStore!.url.toString() }); - } - // Session got expired if (userDataSyncError.code === UserDataSyncErrorCode.SessionExpired) { await this.turnOff(false, true /* force soft turnoff on error */); @@ -361,8 +341,6 @@ export class UserDataAutoSyncService extends Disposable implements IUserDataAuto this.sources.push(...sources); return this.syncTriggerDelayer.trigger(async () => { this.logService.trace('activity sources', ...this.sources); - const providerId = this.userDataSyncAccountService.account?.authenticationProviderId || ''; - this.telemetryService.publicLog2<{ sources: string[]; providerId: string }, AutoSyncClassification>('sync/triggered', { sources: this.sources, providerId }); this.sources = []; if (this.autoSync.value) { await this.autoSync.value.sync('Activity', disableCache); diff --git a/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts b/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts index 858dd8d3b47f6..163f805c73095 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncEnablementService.ts @@ -8,15 +8,8 @@ import { Disposable } from '../../../base/common/lifecycle.js'; import { isWeb } from '../../../base/common/platform.js'; import { IEnvironmentService } from '../../environment/common/environment.js'; import { IApplicationStorageValueChangeEvent, IStorageService, StorageScope, StorageTarget } from '../../storage/common/storage.js'; -import { ITelemetryService } from '../../telemetry/common/telemetry.js'; import { ALL_SYNC_RESOURCES, getEnablementKey, IUserDataSyncEnablementService, IUserDataSyncStoreManagementService, SyncResource } from './userDataSync.js'; -type SyncEnablementClassification = { - owner: 'sandy081'; - comment: 'Reporting when Settings Sync is turned on or off'; - enabled?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Flag indicating if settings sync is enabled or not' }; -}; - const enablementKey = 'sync.enable'; export class UserDataSyncEnablementService extends Disposable implements IUserDataSyncEnablementService { @@ -31,7 +24,6 @@ export class UserDataSyncEnablementService extends Disposable implements IUserDa constructor( @IStorageService private readonly storageService: IStorageService, - @ITelemetryService private readonly telemetryService: ITelemetryService, @IEnvironmentService protected readonly environmentService: IEnvironmentService, @IUserDataSyncStoreManagementService private readonly userDataSyncStoreManagementService: IUserDataSyncStoreManagementService, ) { @@ -57,7 +49,6 @@ export class UserDataSyncEnablementService extends Disposable implements IUserDa if (enabled && !this.canToggleEnablement()) { return; } - this.telemetryService.publicLog2<{ enabled: boolean }, SyncEnablementClassification>(enablementKey, { enabled }); this.storageService.store(enablementKey, enabled, StorageScope.APPLICATION, StorageTarget.MACHINE); } diff --git a/src/vs/workbench/browser/web.main.ts b/src/vs/workbench/browser/web.main.ts index 09bf7f6afac61..5dcdad8aaacc7 100644 --- a/src/vs/workbench/browser/web.main.ts +++ b/src/vs/workbench/browser/web.main.ts @@ -40,7 +40,7 @@ import { isWorkspaceToOpen, isFolderToOpen } from '../../platform/window/common/ import { getSingleFolderWorkspaceIdentifier, getWorkspaceIdentifier } from '../services/workspaces/browser/workspaces.js'; import { InMemoryFileSystemProvider } from '../../platform/files/common/inMemoryFilesystemProvider.js'; import { ICommandService } from '../../platform/commands/common/commands.js'; -import { IndexedDBFileSystemProviderErrorDataClassification, IndexedDBFileSystemProvider, IndexedDBFileSystemProviderErrorData } from '../../platform/files/browser/indexedDBFileSystemProvider.js'; +import { IndexedDBFileSystemProvider } from '../../platform/files/browser/indexedDBFileSystemProvider.js'; import { BrowserRequestService } from '../services/request/browser/requestService.js'; import { IRequestService } from '../../platform/request/common/request.js'; import { IUserDataInitializationService, IUserDataInitializer, UserDataInitializationService } from '../services/userData/browser/userDataInit.js'; @@ -64,7 +64,6 @@ import { IOpenerService } from '../../platform/opener/common/opener.js'; import { mixin, safeStringify } from '../../base/common/objects.js'; import { IndexedDB } from '../../base/browser/indexedDB.js'; import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js'; -import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; import { IProgressService } from '../../platform/progress/common/progress.js'; import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js'; import { dirname, joinPath } from '../../base/common/resources.js'; @@ -137,13 +136,6 @@ export class BrowserMain extends Disposable { // Logging services.logService.trace('workbench#open with configuration', safeStringify(this.configuration)); - instantiationService.invokeFunction(accessor => { - const telemetryService = accessor.get(ITelemetryService); - for (const indexedDbFileSystemProvider of this.indexedDBFileSystemProviders) { - this._register(indexedDbFileSystemProvider.onReportError(e => telemetryService.publicLog2('indexedDBFileSystemProviderError', e))); - } - }); - // Return API Facade return instantiationService.invokeFunction(accessor => { const commandService = accessor.get(ICommandService); diff --git a/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts b/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts index f9284ebbd8a54..12cf0a6c61fc1 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionRecommendationsService.ts @@ -30,13 +30,6 @@ import { IRemoteExtensionsScannerService } from '../../../../platform/remote/com import { IUserDataInitializationService } from '../../../services/userData/browser/userDataInit.js'; import { isString } from '../../../../base/common/types.js'; -type IgnoreRecommendationClassification = { - owner: 'sandy081'; - comment: 'Report when a recommendation is ignored'; - recommendationReason: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Reason why extension is recommended' }; - extensionId: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight'; comment: 'Id of the extension recommendation that is being ignored' }; -}; - export class ExtensionRecommendationsService extends Disposable implements IExtensionRecommendationsService { declare readonly _serviceBrand: undefined; @@ -115,14 +108,6 @@ export class ExtensionRecommendationsService extends Disposable implements IExte ]); this._register(Event.any(this.workspaceRecommendations.onDidChangeRecommendations, this.configBasedRecommendations.onDidChangeRecommendations, this.extensionRecommendationsManagementService.onDidChangeIgnoredRecommendations)(() => this._onDidChangeRecommendations.fire())); - this._register(this.extensionRecommendationsManagementService.onDidChangeGlobalIgnoredRecommendation(({ extensionId, isRecommended }) => { - if (!isRecommended) { - const reason = this.getAllRecommendationsWithReason()[extensionId]; - if (reason && reason.reasonId) { - this.telemetryService.publicLog2<{ extensionId: string; recommendationReason: ExtensionRecommendationReason }, IgnoreRecommendationClassification>('extensionsRecommendations:ignoreRecommendation', { extensionId, recommendationReason: reason.reasonId }); - } - } - })); this.promptWorkspaceRecommendations(); } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts index 729d5d96019bf..3f508b8bf8994 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.ts @@ -38,7 +38,6 @@ import { onUnexpectedError } from '../../../../base/common/errors.js'; import { renderIcon } from '../../../../base/browser/ui/iconLabel/iconLabels.js'; import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js'; import { KeyCode } from '../../../../base/common/keyCodes.js'; -import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; import { defaultCountBadgeStyles } from '../../../../platform/theme/browser/defaultStyles.js'; import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js'; import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; @@ -247,7 +246,6 @@ export class SponsorWidget extends ExtensionWidget { private container: HTMLElement, @IHoverService private readonly hoverService: IHoverService, @IOpenerService private readonly openerService: IOpenerService, - @ITelemetryService private readonly telemetryService: ITelemetryService, ) { super(); this.render(); @@ -267,15 +265,6 @@ export class SponsorWidget extends ExtensionWidget { const label = $('span', undefined, localize('sponsor', "Sponsor")); append(sponsor, sponsorIconElement, label); this.disposables.add(onClick(sponsor, () => { - type SponsorExtensionClassification = { - owner: 'sandy081'; - comment: 'Reporting when sponosor extension action is executed'; - 'extensionId': { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Id of the extension to be sponsored' }; - }; - type SponsorExtensionEvent = { - 'extensionId': string; - }; - this.telemetryService.publicLog2('extensionsAction.sponsorExtension', { extensionId: this.extension!.identifier.id }); this.openerService.open(this.extension!.publisherSponsorLink!); })); } diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts index 56e0f1638ca7b..e68c51bcfa4e0 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts @@ -847,11 +847,6 @@ class Extensions extends Disposable { if (!this.galleryService.isEnabled()) { return; } - type GalleryServiceMatchInstalledExtensionClassification = { - owner: 'sandy081'; - comment: 'Report when a request is made to match installed extension with gallery'; - }; - this.telemetryService.publicLog2<{}, GalleryServiceMatchInstalledExtensionClassification>('galleryService:matchInstalledExtension'); const galleryExtensions = await this.galleryService.getExtensions(toMatch.map(e => ({ ...e.identifier, preRelease: e.local?.preRelease })), { compatible: true, targetPlatform: await this.server.extensionManagementService.getTargetPlatform() }, CancellationToken.None); for (const extension of extensions) { const compatible = galleryExtensions.find(e => areSameExtensions(e.identifier, extension.identifier)); @@ -2925,29 +2920,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension } private async doSetEnablement(extensions: IExtension[], enablementState: EnablementState): Promise { - const changed = await this.extensionEnablementService.setEnablement(extensions.map(e => e.local!), enablementState); - for (let i = 0; i < changed.length; i++) { - if (changed[i]) { - /* __GDPR__ - "extension:enable" : { - "owner": "sandy081", - "${include}": [ - "${GalleryExtensionTelemetryData}" - ] - } - */ - /* __GDPR__ - "extension:disable" : { - "owner": "sandy081", - "${include}": [ - "${GalleryExtensionTelemetryData}" - ] - } - */ - this.telemetryService.publicLog(enablementState === EnablementState.EnabledGlobally || enablementState === EnablementState.EnabledWorkspace ? 'extension:enable' : 'extension:disable', extensions[i].telemetryData); - } - } - return changed; + return await this.extensionEnablementService.setEnablement(extensions.map(e => e.local!), enablementState); } // Current service reports progress when installing/uninstalling extensions diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index eb6d7d3bb43bc..5de358b38d510 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -1923,10 +1923,6 @@ class SyncControls extends Disposable { DOM.hide(this.turnOnSyncButton.element); this._register(this.turnOnSyncButton.onDidClick(async () => { - telemetryService.publicLog2<{}, { - owner: 'sandy081'; - comment: 'This event tracks whenever settings sync is turned on from settings editor.'; - }>('sync/turnOnSyncFromSettings'); await this.commandService.executeCommand('workbench.userDataSync.actions.turnOn'); })); diff --git a/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts b/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts index 73de190f4cc45..e77b3838e7d56 100644 --- a/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts +++ b/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.ts @@ -20,7 +20,6 @@ import { ConfigurationTarget, ConfigurationTargetToString, IConfigurationService import { ITextFileService, ITextFileSaveEvent, ITextFileResolveEvent } from '../../../services/textfile/common/textfiles.js'; import { extname, basename, isEqual, isEqualOrParent } from '../../../../base/common/resources.js'; import { URI } from '../../../../base/common/uri.js'; -import { Event } from '../../../../base/common/event.js'; import { Schemas } from '../../../../base/common/network.js'; import { getMimeTypes } from '../../../../editor/common/services/languagesAssociations.js'; import { hash } from '../../../../base/common/hash.js'; @@ -246,31 +245,6 @@ class ConfigurationTelemetryContribution extends Disposable implements IWorkbenc ) { super(); - // Debounce the event by 1000 ms and merge all affected keys into one event - const debouncedConfigService = Event.debounce(configurationService.onDidChangeConfiguration, (last, cur) => { - const newAffectedKeys: ReadonlySet = last ? new Set([...last.affectedKeys, ...cur.affectedKeys]) : cur.affectedKeys; - return { ...cur, affectedKeys: newAffectedKeys }; - }, 1000, true); - - this._register(debouncedConfigService(event => { - if (event.source !== ConfigurationTarget.DEFAULT) { - type UpdateConfigurationClassification = { - owner: 'sandy081'; - comment: 'Event which fires when user updates settings'; - configurationSource: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'What configuration file was updated i.e user or workspace' }; - configurationKeys: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'What configuration keys were updated' }; - }; - type UpdateConfigurationEvent = { - configurationSource: string; - configurationKeys: string[]; - }; - telemetryService.publicLog2('updateConfiguration', { - configurationSource: ConfigurationTargetToString(event.source), - configurationKeys: Array.from(event.affectedKeys) - }); - } - })); - const { user, workspace } = configurationService.keys(); for (const setting of user) { this.reportTelemetry(setting, ConfigurationTarget.USER_LOCAL); diff --git a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.ts b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.ts index bef5074bad83c..6cd4321ee4248 100644 --- a/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.ts +++ b/src/vs/workbench/contrib/userDataProfile/browser/userDataProfilesEditorModel.ts @@ -1209,7 +1209,6 @@ export class UserDataProfilesEditorModel extends EditorModel { ); } } else if (isUserDataProfile(copyFrom)) { - this.telemetryService.publicLog2('userDataProfile.createFromProfile', createProfileTelemetryData); profile = await this.userDataProfileImportExportService.createFromProfile( copyFrom, { @@ -1222,7 +1221,6 @@ export class UserDataProfilesEditorModel extends EditorModel { token ?? CancellationToken.None ); } else { - this.telemetryService.publicLog2('userDataProfile.createEmptyProfile', createProfileTelemetryData); profile = await this.userDataProfileManagementService.createProfile(name, { useDefaultFlags, icon, transient }); } } diff --git a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts index 6a2c8ceb17a6b..261987d460e96 100644 --- a/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts +++ b/src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts @@ -189,14 +189,12 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo { label: localize('replace remote', "Replace Remote"), run: () => { - this.telemetryService.publicLog2<{ source: string; action: string }, SyncConflictsClassification>('sync/handleConflicts', { source: conflict.syncResource, action: 'acceptLocal' }); this.acceptLocal(conflict, conflict.conflicts[0]); } }, { label: localize('replace local', "Replace Local"), run: () => { - this.telemetryService.publicLog2<{ source: string; action: string }, SyncConflictsClassification>('sync/handleConflicts', { source: conflict.syncResource, action: 'acceptRemote' }); this.acceptRemote(conflict, conflict.conflicts[0]); } }, diff --git a/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts b/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts index 04aa6fe51f846..b5f67878d99a5 100644 --- a/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts +++ b/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts @@ -26,7 +26,6 @@ import { mainWindow } from '../../../../base/browser/window.js'; import { ICommandService } from '../../../../platform/commands/common/commands.js'; import { isCancellationError } from '../../../../base/common/errors.js'; import { INotificationService } from '../../../../platform/notification/common/notification.js'; -import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js'; import { ResourceMap } from '../../../../base/common/map.js'; const FIVE_MINUTES = 5 * 60 * 1000; @@ -88,18 +87,6 @@ type ExtensionUrlHandlerClassification = { comment: 'This is used to understand the drop funnel of extension URI handling by the OS & VS Code.'; }; -interface ExtensionUrlReloadHandlerEvent { - readonly extensionId: string; - readonly isRemote: boolean; -} - -type ExtensionUrlReloadHandlerClassification = { - owner: 'sandy081'; - readonly extensionId: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight'; comment: 'The ID of the extension that should handle the URI' }; - readonly isRemote: { classification: 'PublicNonPersonalData'; purpose: 'FeatureInsight'; comment: 'Whether the current window is a remote window' }; - comment: 'This is used to understand the drop funnel of extension URI handling by the OS & VS Code.'; -}; - export interface IExtensionUrlHandlerOverride { handleURL(uri: URI): Promise; } @@ -148,7 +135,6 @@ class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler { @ITelemetryService private readonly telemetryService: ITelemetryService, @INotificationService private readonly notificationService: INotificationService, @IProductService private readonly productService: IProductService, - @IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService ) { this.userTrustedExtensionsStorage = new UserTrustedExtensionIdStorage(storageService); @@ -311,7 +297,6 @@ class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler { /* Extension cannot be added and require window reload */ else { - this.telemetryService.publicLog2('uri_invoked/install_extension/reload', { extensionId, isRemote: !!this.workbenchEnvironmentService.remoteAuthority }); const result = await this.dialogService.confirm({ message: localize('reloadAndHandle', "Extension '{0}' is not loaded. Would you like to reload the window to load the extension and open the URL?", extensionId), primaryButton: localize({ key: 'reloadAndOpen', comment: ['&& denotes a mnemonic'] }, "&&Reload Window and Open") diff --git a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts index a552fa1533337..d38ab6b10ae36 100644 --- a/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts +++ b/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts @@ -467,16 +467,6 @@ export class NativeExtensionService extends AbstractExtensionService implements if (!recommendation) { return false; } - const sendTelemetry = (userReaction: 'install' | 'enable' | 'cancel') => { - /* __GDPR__ - "remoteExtensionRecommendations:popup" : { - "owner": "sandy081", - "userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, - "extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" } - } - */ - this._telemetryService.publicLog('remoteExtensionRecommendations:popup', { userReaction, extensionId: resolverExtensionId }); - }; const resolverExtensionId = recommendation.extensionId; const allExtensions = await this._scanAllLocalExtensions(); @@ -488,7 +478,6 @@ export class NativeExtensionService extends AbstractExtensionService implements [{ label: nls.localize('enable', 'Enable and Reload'), run: async () => { - sendTelemetry('enable'); await this._extensionEnablementService.setEnablement([toExtension(extension)], EnablementState.EnabledGlobally); await this._hostService.reload(); } @@ -506,7 +495,6 @@ export class NativeExtensionService extends AbstractExtensionService implements [{ label: nls.localize('install', 'Install and Reload'), run: async () => { - sendTelemetry('install'); const [galleryExtension] = await this._extensionGalleryService.getExtensions([{ id: resolverExtensionId }], CancellationToken.None); if (galleryExtension) { await this._extensionManagementService.installFromGallery(galleryExtension); @@ -520,7 +508,6 @@ export class NativeExtensionService extends AbstractExtensionService implements { sticky: true, priority: NotificationPriority.URGENT, - onCancel: () => sendTelemetry('cancel') } ); diff --git a/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts b/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts index e4b29d57e5395..cc56d9a6ac537 100644 --- a/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts +++ b/src/vs/workbench/services/userDataProfile/browser/userDataProfileManagement.ts @@ -15,7 +15,6 @@ import { InstantiationType, registerSingleton } from '../../../../platform/insta import { ILogService } from '../../../../platform/log/common/log.js'; import { IProductService } from '../../../../platform/product/common/productService.js'; import { IRequestService, asJson } from '../../../../platform/request/common/request.js'; -import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; import { IUserDataProfile, IUserDataProfileOptions, IUserDataProfilesService, IUserDataProfileUpdateOptions } from '../../../../platform/userDataProfile/common/userDataProfile.js'; import { isEmptyWorkspaceIdentifier, IWorkspaceContextService, toWorkspaceIdentifier } from '../../../../platform/workspace/common/workspace.js'; @@ -25,16 +24,6 @@ import { IExtensionService } from '../../extensions/common/extensions.js'; import { IHostService } from '../../host/browser/host.js'; import { DidChangeUserDataProfileEvent, IProfileTemplateInfo, IUserDataProfileManagementService, IUserDataProfileService } from '../common/userDataProfile.js'; -export type ProfileManagementActionExecutedClassification = { - owner: 'sandy081'; - comment: 'Logged when profile management action is excuted'; - id: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier of the action that was run.' }; -}; - -export type ProfileManagementActionExecutedEvent = { - id: string; -}; - export class UserDataProfileManagementService extends Disposable implements IUserDataProfileManagementService { readonly _serviceBrand: undefined; @@ -46,7 +35,6 @@ export class UserDataProfileManagementService extends Disposable implements IUse @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService, @IExtensionService private readonly extensionService: IExtensionService, @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService, - @ITelemetryService private readonly telemetryService: ITelemetryService, @IProductService private readonly productService: IProductService, @IRequestService private readonly requestService: IRequestService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -122,14 +110,12 @@ export class UserDataProfileManagementService extends Disposable implements IUse async createAndEnterProfile(name: string, options?: IUserDataProfileOptions): Promise { const profile = await this.userDataProfilesService.createNamedProfile(name, options, toWorkspaceIdentifier(this.workspaceContextService.getWorkspace())); await this.changeCurrentProfile(profile); - this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'createAndEnterProfile' }); return profile; } async createAndEnterTransientProfile(): Promise { const profile = await this.userDataProfilesService.createTransientProfile(toWorkspaceIdentifier(this.workspaceContextService.getWorkspace())); await this.changeCurrentProfile(profile); - this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'createAndEnterTransientProfile' }); return profile; } @@ -141,7 +127,6 @@ export class UserDataProfileManagementService extends Disposable implements IUse throw new Error(localize('cannotRenameDefaultProfile', "Cannot rename the default profile")); } const updatedProfile = await this.userDataProfilesService.updateProfile(profile, updateOptions); - this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'updateProfile' }); return updatedProfile; } @@ -153,7 +138,6 @@ export class UserDataProfileManagementService extends Disposable implements IUse throw new Error(localize('cannotDeleteDefaultProfile', "Cannot delete the default profile")); } await this.userDataProfilesService.removeProfile(profile); - this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'removeProfile' }); } async switchProfile(profile: IUserDataProfile): Promise { @@ -169,7 +153,6 @@ export class UserDataProfileManagementService extends Disposable implements IUse } const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace()); await this.userDataProfilesService.setProfileForWorkspace(workspaceIdentifier, profile); - this.telemetryService.publicLog2('profileManagementActionExecuted', { id: 'switchProfile' }); if (isEmptyWorkspaceIdentifier(workspaceIdentifier)) { await this.changeCurrentProfile(profile); } diff --git a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts index 6a1eb065c6c19..ea27f81b3bdf1 100644 --- a/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts +++ b/src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { IUserDataSyncService, IAuthenticationProvider, isAuthenticationProvider, IUserDataAutoSyncService, IUserDataSyncStoreManagementService, SyncStatus, IUserDataSyncEnablementService, IUserDataSyncResource, IResourcePreview, USER_DATA_SYNC_SCHEME, USER_DATA_SYNC_LOG_ID, } from '../../../../platform/userDataSync/common/userDataSync.js'; -import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; import { IUserDataSyncWorkbenchService, IUserDataSyncAccount, AccountStatus, CONTEXT_SYNC_ENABLEMENT, CONTEXT_SYNC_STATE, CONTEXT_ACCOUNT_STATE, SHOW_SYNC_LOG_COMMAND_ID, CONTEXT_ENABLE_ACTIVITY_VIEWS, SYNC_VIEW_CONTAINER_ID, SYNC_TITLE, SYNC_CONFLICTS_VIEW_ID, CONTEXT_ENABLE_SYNC_CONFLICTS_VIEW, CONTEXT_HAS_CONFLICTS, IUserDataSyncConflictsView, getSyncAreaLabel } from '../common/userDataSync.js'; import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js'; @@ -104,7 +103,6 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat @IStorageService private readonly storageService: IStorageService, @IUserDataSyncEnablementService private readonly userDataSyncEnablementService: IUserDataSyncEnablementService, @IUserDataAutoSyncService private readonly userDataAutoSyncService: IUserDataAutoSyncService, - @ITelemetryService private readonly telemetryService: ITelemetryService, @ILogService private readonly logService: ILogService, @IProductService private readonly productService: IProductService, @IExtensionService private readonly extensionService: IExtensionService, @@ -716,7 +714,6 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat } private async onDidAuthFailure(): Promise { - this.telemetryService.publicLog2<{}, { owner: 'sandy081'; comment: 'Report when there are successive auth failures during settings sync' }>('sync/successiveAuthFailures'); this.currentSessionId = undefined; await this.update('auth failure'); } From 872a3ef62d2e07c840801b182445bb5deb314b1a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 17 Jan 2025 17:26:38 +0100 Subject: [PATCH 2/2] fix compilation --- .../extensionsProfileScannerService.ts | 4 +--- .../node/extensionsProfileScannerService.ts | 4 +--- .../test/node/extensionsScannerService.test.ts | 3 +-- .../files/browser/indexedDBFileSystemProvider.ts | 11 ++--------- .../browser/extensionsProfileScannerService.ts | 4 +--- 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts b/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts index 2299ce880033c..c9ae2f8a5e06d 100644 --- a/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts +++ b/src/vs/platform/extensionManagement/electron-sandbox/extensionsProfileScannerService.ts @@ -6,7 +6,6 @@ import { ILogService } from '../../log/common/log.js'; import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; -import { ITelemetryService } from '../../telemetry/common/telemetry.js'; import { AbstractExtensionsProfileScannerService, IExtensionsProfileScannerService } from '../common/extensionsProfileScannerService.js'; import { IFileService } from '../../files/common/files.js'; import { INativeEnvironmentService } from '../../environment/common/environment.js'; @@ -19,10 +18,9 @@ export class ExtensionsProfileScannerService extends AbstractExtensionsProfileSc @IFileService fileService: IFileService, @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, @IUriIdentityService uriIdentityService: IUriIdentityService, - @ITelemetryService telemetryService: ITelemetryService, @ILogService logService: ILogService, ) { - super(URI.file(environmentService.extensionsPath), fileService, userDataProfilesService, uriIdentityService, telemetryService, logService); + super(URI.file(environmentService.extensionsPath), fileService, userDataProfilesService, uriIdentityService, logService); } } diff --git a/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts b/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts index 3f1e919161f0a..131d918556246 100644 --- a/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts +++ b/src/vs/platform/extensionManagement/node/extensionsProfileScannerService.ts @@ -6,7 +6,6 @@ import { ILogService } from '../../log/common/log.js'; import { IUserDataProfilesService } from '../../userDataProfile/common/userDataProfile.js'; import { IUriIdentityService } from '../../uriIdentity/common/uriIdentity.js'; -import { ITelemetryService } from '../../telemetry/common/telemetry.js'; import { AbstractExtensionsProfileScannerService } from '../common/extensionsProfileScannerService.js'; import { IFileService } from '../../files/common/files.js'; import { INativeEnvironmentService } from '../../environment/common/environment.js'; @@ -18,9 +17,8 @@ export class ExtensionsProfileScannerService extends AbstractExtensionsProfileSc @IFileService fileService: IFileService, @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, @IUriIdentityService uriIdentityService: IUriIdentityService, - @ITelemetryService telemetryService: ITelemetryService, @ILogService logService: ILogService, ) { - super(URI.file(environmentService.extensionsPath), fileService, userDataProfilesService, uriIdentityService, telemetryService, logService); + super(URI.file(environmentService.extensionsPath), fileService, userDataProfilesService, uriIdentityService, logService); } } diff --git a/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts b/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts index ea4108b2c17eb..1d349f5822abd 100644 --- a/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts +++ b/src/vs/platform/extensionManagement/test/node/extensionsScannerService.test.ts @@ -19,7 +19,6 @@ import { IInstantiationService } from '../../../instantiation/common/instantiati import { TestInstantiationService } from '../../../instantiation/test/common/instantiationServiceMock.js'; import { ILogService, NullLogService } from '../../../log/common/log.js'; import { IProductService } from '../../../product/common/productService.js'; -import { NullTelemetryService } from '../../../telemetry/common/telemetryUtils.js'; import { IUriIdentityService } from '../../../uriIdentity/common/uriIdentity.js'; import { UriIdentityService } from '../../../uriIdentity/common/uriIdentityService.js'; import { IUserDataProfilesService, UserDataProfilesService } from '../../../userDataProfile/common/userDataProfile.js'; @@ -81,7 +80,7 @@ suite('NativeExtensionsScanerService Test', () => { instantiationService.stub(IUriIdentityService, uriIdentityService); const userDataProfilesService = disposables.add(new UserDataProfilesService(environmentService, fileService, uriIdentityService, logService)); instantiationService.stub(IUserDataProfilesService, userDataProfilesService); - instantiationService.stub(IExtensionsProfileScannerService, disposables.add(new ExtensionsProfileScannerService(environmentService, fileService, userDataProfilesService, uriIdentityService, NullTelemetryService, logService))); + instantiationService.stub(IExtensionsProfileScannerService, disposables.add(new ExtensionsProfileScannerService(environmentService, fileService, userDataProfilesService, uriIdentityService, logService))); await fileService.createFolder(systemExtensionsLocation); await fileService.createFolder(userExtensionsLocation); }); diff --git a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts index 67c6b1e919241..5da9d07288062 100644 --- a/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts +++ b/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts @@ -11,8 +11,8 @@ import { ExtUri } from '../../../base/common/resources.js'; import { isString } from '../../../base/common/types.js'; import { URI, UriDto } from '../../../base/common/uri.js'; import { localize } from '../../../nls.js'; -import { createFileSystemProviderError, FileChangeType, IFileDeleteOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions } from '../common/files.js'; -import { DBClosedError, IndexedDB } from '../../../base/browser/indexedDB.js'; +import { createFileSystemProviderError, FileChangeType, IFileDeleteOptions, IFileOverwriteOptions, FileSystemProviderCapabilities, FileSystemProviderErrorCode, FileType, IFileWriteOptions, IFileChange, IFileSystemProviderWithFileReadWriteCapability, IStat, IWatchOptions } from '../common/files.js'; +import { IndexedDB } from '../../../base/browser/indexedDB.js'; import { BroadcastDataChannel } from '../../../base/browser/broadcast.js'; // Standard FS Errors (expected to be thrown in production when invalid FS operations are requested) @@ -238,7 +238,6 @@ export class IndexedDBFileSystemProvider extends Disposable implements IFileSyst return [...entry.children.entries()].map(([name, node]) => [name, node.type]); } } catch (error) { - this.reportError('readDir', error); throw error; } } @@ -260,7 +259,6 @@ export class IndexedDBFileSystemProvider extends Disposable implements IFileSyst return buffer; } catch (error) { - this.reportError('readFile', error); throw error; } } @@ -273,7 +271,6 @@ export class IndexedDBFileSystemProvider extends Disposable implements IFileSyst } await this.bulkWrite([[resource, content]]); } catch (error) { - this.reportError('writeFile', error); throw error; } } @@ -435,8 +432,4 @@ export class IndexedDBFileSystemProvider extends Disposable implements IFileSyst await this.indexedDB.runInTransaction(this.store, 'readwrite', objectStore => objectStore.clear()); } - private reportError(operation: string, error: Error): void { - this._onReportError.fire({ scheme: this.scheme, operation, code: error instanceof FileSystemProviderError || error instanceof DBClosedError ? error.code : 'unknown' }); - } - } diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionsProfileScannerService.ts b/src/vs/workbench/services/extensionManagement/browser/extensionsProfileScannerService.ts index edcd2c4775c2c..cd083d884f9f6 100644 --- a/src/vs/workbench/services/extensionManagement/browser/extensionsProfileScannerService.ts +++ b/src/vs/workbench/services/extensionManagement/browser/extensionsProfileScannerService.ts @@ -6,7 +6,6 @@ import { ILogService } from '../../../../platform/log/common/log.js'; import { IUserDataProfilesService } from '../../../../platform/userDataProfile/common/userDataProfile.js'; import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; -import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; import { AbstractExtensionsProfileScannerService, IExtensionsProfileScannerService } from '../../../../platform/extensionManagement/common/extensionsProfileScannerService.js'; import { IFileService } from '../../../../platform/files/common/files.js'; import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; @@ -18,10 +17,9 @@ export class ExtensionsProfileScannerService extends AbstractExtensionsProfileSc @IFileService fileService: IFileService, @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, @IUriIdentityService uriIdentityService: IUriIdentityService, - @ITelemetryService telemetryService: ITelemetryService, @ILogService logService: ILogService, ) { - super(environmentService.userRoamingDataHome, fileService, userDataProfilesService, uriIdentityService, telemetryService, logService); + super(environmentService.userRoamingDataHome, fileService, userDataProfilesService, uriIdentityService, logService); } }