fix: sync telemetry logger enable states#17693
Open
suzunn wants to merge 1 commit into
Open
Conversation
ndoschek
requested changes
Jul 2, 2026
Member
There was a problem hiding this comment.
Thanks for the fix, @suzunn!
Two quick housekeeping items first:
- The ECA check is failing. Could you sign the Eclipse Contributor Agreement and make sure the email on your commits matches. Details here: https://github.com/eclipse-theia/theia/blob/master/CONTRIBUTING.md#eclipse-contributor-agreement
- Could you also update the PR description to follow our PR template? We rely on the sections for our automated changelog generation. Thanks!
The approach itself looks good and I can verify the issue is fixed using the reproduction steps from the linked issue. 👍
About the setup issues you ran into on Windows, this page might help: https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#windows. Heads up though, that section is a bit outdated (it still mentions msvs_version 2017); for Node 22 for example you'll want at least Visual Studio 2022 Build Tools with the C++ workload. I'll take care of updating this part! (edit: see also here for the wip: #17752)
| @@ -0,0 +1,61 @@ | |||
| // ***************************************************************************** | |||
| // Copyright (C) 2026 EclipseSource and others. | |||
Member
There was a problem hiding this comment.
You can put yourself/your company as copyright holder here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TelemetryLoggerinitializedisUsageEnabledandisErrorsEnabledtotrueregardless of the current telemetry setting. That means extensions can see telemetry as enabled even whenenv.isTelemetryEnabledis false, which can cause telemetry senders to initialize unnecessarily.Solution
I updated
TelemetryLoggerso its usage and error enable states mirror the current telemetry-enabled state when a logger is created and whenever telemetry is toggled. I also added focused coverage for the initial disabled state, toggling back and forth, andonDidChangeEnableStatesnotifications.Fixes #17592.
Testing
npx eslint packages\plugin-ext\src\plugin\telemetry-ext.ts packages\plugin-ext\src\plugin\telemetry-ext.spec.tsgit diff --check origin/master...HEADI also tried to run the local compile/test path, but this Windows environment cannot complete the repository setup cleanly:
npm cifails while building the nativedrivelistdependency because no Visual Studio C++ workload is installed, and the fallback install leaves some generated Theia workspace references unavailable for package compilation.