continue-custom/extensions
Jakub Błach b33726fa95
fix: apply Sentry and PostHog telemetry settings correctly (#6894)
* fix: apply Sentry and PostHog telemetry settings correctly

Now we are very strict about telemetry config. If anything fails (plugin service is null, no/invalid config response, etc.), the flag falls back to false.

More details:
* Because we need to poll settings ourselves (via getSerializedProfileInfo), I created a new service that holds that setting.
* This service implements an interface to allow separation that enables us to write unit tests. Unit tests only cover PostHog telemetry behavior. I tried to write tests for Sentry, but it’s problematic because the initialization is static and I couldn’t mock it (mockkStatic doesn’t work). I decided not to spend more time on it, especially since the telemetry checks are identical to PostHog (it's just `if`). I think that should be enough.
* Status polling is lazy, so as long as no one asks for allowAnonymousTelemetry (so if no error occurs), polling is inactive. This is a side effect of having it as a service, but I think it’s a nice feature in this context.
* If telemetry is disabled but the user submits an error via the Report to Continue dialog, will be sent anyway (because this is an explicit decision). This action is one-time and does not change the global telemetry settings.

To summarize, we now have three services:

* ContinueTelemetryStatusService - holds state in a non-blocking way and handles polling itself
* ContinuePostHogService - previously TelemetryService
* ContinueSentryService - previously ContinueErrorService

* fix: retrieve telemetry status service from the first project
2025-07-30 11:19:44 -07:00
..
intellij fix: apply Sentry and PostHog telemetry settings correctly (#6894) 2025-07-30 11:19:44 -07:00
vscode Merge pull request #6844 from continuedev/tingwai/fix-docs 2025-07-29 14:07:09 -07:00