-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Update to 1.71 #5535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to 1.71 #5535
Changes from 2 commits
9c40709
9676fe6
ffcd6a4
a688920
ddbe271
83deac8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
Add support for telemetry endpoint | ||
|
||
Contains some fixes included in https://github.com/microsoft/vscode/commit/b108bc8294ce920fcf2ee8d53f97c3bcf3316e1c | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice addition 👍🏼 |
||
|
||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts | ||
=================================================================== | ||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts | ||
|
@@ -86,12 +88,45 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme | |
=================================================================== | ||
--- code-server.orig/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts | ||
+++ code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts | ||
@@ -38,26 +38,30 @@ export class TelemetryService extends Di | ||
@@ -15,7 +15,7 @@ import { ClassifiedEvent, IGDPRProperty, | ||
import { ITelemetryData, ITelemetryInfo, ITelemetryService, TelemetryLevel, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry'; | ||
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender'; | ||
import { ITelemetryServiceConfig, TelemetryService as BaseTelemetryService } from 'vs/platform/telemetry/common/telemetryService'; | ||
-import { isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; | ||
+import { getTelemetryLevel, isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; | ||
import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService'; | ||
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; | ||
import { resolveWorkbenchCommonProperties } from 'vs/workbench/services/telemetry/browser/workbenchCommonProperties'; | ||
@@ -24,7 +24,7 @@ export class TelemetryService extends Di | ||
|
||
declare readonly _serviceBrand: undefined; | ||
|
||
- private impl: ITelemetryService; | ||
+ private impl: ITelemetryService = NullTelemetryService; | ||
public readonly sendErrorTelemetry = true; | ||
|
||
constructor( | ||
@@ -37,11 +37,7 @@ export class TelemetryService extends Di | ||
) { | ||
super(); | ||
|
||
- if (supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey) { | ||
+ if (supportsTelemetry(productService, environmentService)) { | ||
- this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService); | ||
- } else { | ||
- this.impl = NullTelemetryService; | ||
- } | ||
+ this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService); | ||
|
||
// When the level changes it could change from off to on and we want to make sure telemetry is properly intialized | ||
this._register(configurationService.onDidChangeConfiguration(e => { | ||
@@ -64,23 +60,28 @@ export class TelemetryService extends Di | ||
productService: IProductService, | ||
remoteAgentService: IRemoteAgentService | ||
) { | ||
- const telemetrySupported = supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey; | ||
- if (telemetrySupported && this.impl === NullTelemetryService && this.telemetryLevel.value !== TelemetryLevel.NONE) { | ||
+ const telemetrySupported = supportsTelemetry(productService, environmentService); | ||
+ if (telemetrySupported && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE && this.impl === NullTelemetryService) { | ||
// If remote server is present send telemetry through that, else use the client side appender | ||
const appenders = []; | ||
const isInternal = isInternalTelemetry(productService, configurationService); | ||
|
@@ -103,14 +138,6 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme | |
- commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties), | ||
- sendErrorTelemetry: this.sendErrorTelemetry, | ||
- }; | ||
- this.impl = this._register(new BaseTelemetryService(config, configurationService, productService)); | ||
- | ||
- if (getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) { | ||
- // If we cannot fetch the endpoint it means it is down and we should not send any telemetry. | ||
- // This is most likely due to ad blockers | ||
- fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => { | ||
- this.impl = NullTelemetryService; | ||
- }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually have no idea what happened with this segment in the original version. I have not found any commit where this was removed or changed. Maybe sbd. finds the reason... |
||
+ const telemetryProvider: ITelemetryAppender | undefined = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : productService.aiConfig?.ariaKey ? new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey) : undefined; | ||
+ if (telemetryProvider) { | ||
+ appenders.push(telemetryProvider); | ||
|
@@ -120,20 +147,19 @@ Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/teleme | |
+ commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties), | ||
+ sendErrorTelemetry: this.sendErrorTelemetry, | ||
+ }; | ||
+ this.impl = this._register(new BaseTelemetryService(config, configurationService, productService)); | ||
+ | ||
+ if (remoteAgentService.getConnection() === null && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE) { | ||
+ // If we cannot fetch the endpoint it means it is down and we should not send any telemetry. | ||
+ // This is most likely due to ad blockers | ||
+ fetch(telemetryEndpointUrl, { method: 'POST' }).catch(err => { | ||
+ this.impl = NullTelemetryService; | ||
+ }); | ||
+ } | ||
+ return this._register(new BaseTelemetryService(config, configurationService, productService)); | ||
+ } else { | ||
+ this.impl = NullTelemetryService; | ||
} | ||
} else { | ||
this.impl = NullTelemetryService; | ||
+ return this.impl; | ||
+ } | ||
|
||
- return this._register(new BaseTelemetryService(config, configurationService, productService)); | ||
} | ||
- return NullTelemetryService; | ||
+ return this.impl; | ||
} | ||
|
||
setExperimentProperty(name: string, value: string): void { | ||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts | ||
=================================================================== | ||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: this change is fine, right?