From 302bcfac2c19626cec93b59e5f9e1cb7b23a4800 Mon Sep 17 00:00:00 2001 From: Justin L Date: Thu, 9 Oct 2025 10:15:25 -0400 Subject: [PATCH] Fix #248: Make analytics opt-in with migration for existing users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed default value of enableAnalytics from true to false to address privacy concerns. Previously, analytics were enabled by default without user consent. Added automatic migration that runs on app startup: - Detects existing users with analytics enabled and automatically disables it - New installations use the new default (false) - Users can manually opt-in through Settings → Privacy This is intentional to correct the privacy violation. Users never actively opted in - analytics were enabled by default. The migration ensures all users (new and existing) have analytics disabled by default while still allowing them to opt in if they choose to support the project. Files changed: - app/containers/Settings/reducers.js (line 22) - app/containers/App/index.jsx (lines 132-145 - migration logic) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/containers/App/index.jsx | 15 +++++++++++++++ app/containers/Settings/reducers.js | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/containers/App/index.jsx b/app/containers/App/index.jsx index 549f3302..ac97a497 100644 --- a/app/containers/App/index.jsx +++ b/app/containers/App/index.jsx @@ -129,6 +129,21 @@ class App extends Component { const { actionCreateCopyJsonFileToSettings } = this.props; const settingsFromStorage = settingsStorage.getAll(); + // Migration: Change analytics to opt-in for all users (Issue #248) + // Previously analytics was opt-out by default, which is a privacy concern. + // This migration ensures all users (new and existing) have analytics disabled by default. + if (typeof settingsFromStorage.enableAnalytics === 'undefined') { + // New installation - use the new default (false) from initialState + settingsFromStorage.enableAnalytics = false; + } else if (settingsFromStorage.enableAnalytics === true) { + // Existing installation with analytics enabled - disable it for privacy + // Users can re-enable if they choose to opt-in + settingsFromStorage.enableAnalytics = false; + + // Persist this change immediately + settingsStorage.setAll({ ...settingsFromStorage }); + } + actionCreateCopyJsonFileToSettings({ ...settingsFromStorage }); } catch (e) { log.error(e, `App -> writeJsonToSettings`); diff --git a/app/containers/Settings/reducers.js b/app/containers/Settings/reducers.js index bd2856a1..0c941f77 100644 --- a/app/containers/Settings/reducers.js +++ b/app/containers/Settings/reducers.js @@ -19,7 +19,7 @@ export const initialState = { enableBackgroundAutoUpdate: true, // if the freshly installed version is a prerelease version then save [enablePrereleaseUpdates] as true enablePrereleaseUpdates: isPrereleaseVersion() || false, - enableAnalytics: true, + enableAnalytics: false, enableStatusBar: true, enableUsbHotplug: false, hideHiddenFiles: {