Skip to content

fix(#701): turn off telemetry by default on self-hosted instances#714

Open
rbalogic wants to merge 1 commit intothunderbird:mainfrom
rbalogic:fix/701-disable-telemetry-by-default
Open

fix(#701): turn off telemetry by default on self-hosted instances#714
rbalogic wants to merge 1 commit intothunderbird:mainfrom
rbalogic:fix/701-disable-telemetry-by-default

Conversation

@rbalogic
Copy link
Copy Markdown

@rbalogic rbalogic commented Apr 21, 2026

Summary

  • Defaulted telemetry (data_collection) to off for self-hosted/OIDC deployments.
  • Kept existing default behavior for consumer/cloud deployments.
  • Centralized the default logic in a helper so all fallback paths stay consistent.
  • Updated telemetry-related fallbacks to use that shared helper instead of hardcoded true.
  • Added focused unit coverage for the mode-based default behavior.

Why?

Self-hosted deployments should be privacy-first by default. This aligns runtime behavior with the intended deployment mode semantics (VITE_AUTH_MODE=oidc).

Changes

  • src/defaults/settings.ts
    • Added getDefaultDataCollectionValue(authMode?: string)
    • Updated default data_collection setting to use that helper.
  • src/lib/posthog.tsx
    • Updated getSettings fallback for data_collection to use the helper.
  • src/settings/preferences.tsx
    • Updated useSettings fallback for data_collection to use the helper.
  • src/defaults/settings.test.ts
    • Added tests covering:
      • oidc -> false
      • consumer -> true
      • undefined mode -> true

Test Plan

  • Verified logic paths in code:
    • OIDC/self-hosted defaults telemetry to off.
    • Consumer/default mode remains on.
  • Added unit tests for default selection helper.
  • Run locally (if needed):
    • bun test src/defaults/settings.test.ts
    • bun test src/lib/posthog.test.ts
    • make format
    • bun run check

Related


Note

Medium Risk
Changes the default telemetry opt-in behavior based on VITE_AUTH_MODE, which can affect analytics initialization and user-visible defaults across deployments. Low implementation complexity, but sensitive due to privacy/telemetry semantics.

Overview
Telemetry (data_collection) is now disabled by default when running in oidc (self-hosted/enterprise) mode, while remaining enabled by default for consumer/unspecified modes.

This centralizes the mode-based default in getDefaultDataCollectionValue() and updates all fallback/default paths (default settings seed, PostHog initialization, and Preferences settings hook) to use it, with a small unit test added to lock in the behavior.

Reviewed by Cursor Bugbot for commit 909efc5. Bugbot is set up for automated code reviews on this repo. Configure here.

@rbalogic rbalogic force-pushed the fix/701-disable-telemetry-by-default branch from 216ed9c to 909efc5 Compare April 23, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turn off Telemetry by default on self-hosted instances

1 participant