diff --git a/packages/devtools_app/lib/src/shared/server/_analytics_api.dart b/packages/devtools_app/lib/src/shared/server/_analytics_api.dart index e5969cc8263..3b3f9dd6455 100644 --- a/packages/devtools_app/lib/src/shared/server/_analytics_api.dart +++ b/packages/devtools_app/lib/src/shared/server/_analytics_api.dart @@ -4,21 +4,6 @@ part of 'server.dart'; -/// Request DevTools property value 'firstRun' (GA dialog) stored in the file -/// '~/flutter-devtools/.devtools'. -Future isFirstRun() async { - bool firstRun = false; - if (isDevToolsServerAvailable) { - final resp = await request(apiGetDevToolsFirstRun); - if (resp?.statusCode == 200) { - firstRun = json.decode(resp!.body); - } else { - logWarning(resp, apiGetDevToolsFirstRun); - } - } - return firstRun; -} - /// Requests the Flutter client id from the Flutter store file ~\.flutter. /// /// If an empty String is returned, this means that Flutter Tool has never been diff --git a/packages/devtools_shared/CHANGELOG.md b/packages/devtools_shared/CHANGELOG.md index 6d2525c17ec..61231012135 100644 --- a/packages/devtools_shared/CHANGELOG.md +++ b/packages/devtools_shared/CHANGELOG.md @@ -4,10 +4,12 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. --> # 13.0.0-wip -* Deprecated `DevToolsStoreKeys.analyticsEnabled` since this is only used for legacy analytics. -* **Breaking change:** Removed legacy analytics APIs and state cleanup (e.g. `apiGetFlutterGAEnabled`, `apiGetDevToolsEnabled`, `apiSetDevToolsEnabled`). +* **Breaking change:** Removed `DevToolsStoreKeys.analyticsEnabled` and +`DevToolsStoreKeys.isFirstRun` since these were only used for legacy analytics. +* **Breaking change:** Removed legacy analytics APIs and state cleanup +(e.g. `apiGetFlutterGAEnabled`, `apiGetDevToolsEnabled`, `apiSetDevToolsEnabled`, `apiGetDevToolsFirstRun`, `apiResetDevTools`). * **Breaking change:** Removed public constant `devToolsEnabledPropertyName`. -* **Breaking change:** Removed the `analyticsEnabled` getter and setter from `DevToolsUsage`. +* **Breaking change:** Removed `isFirstRun`, `reset`, and `analyticsEnabled` from `DevToolsUsage`. # 12.1.0 * Adds additional logging to `IntegrationTestRunner`. diff --git a/packages/devtools_shared/lib/src/devtools_api.dart b/packages/devtools_shared/lib/src/devtools_api.dart index fc1bfb50987..f28ffbbf0a5 100644 --- a/packages/devtools_shared/lib/src/devtools_api.dart +++ b/packages/devtools_shared/lib/src/devtools_api.dart @@ -17,10 +17,6 @@ const apiParameterVmServiceConnected = 'connected'; /// Flutter GA properties APIs: const apiGetFlutterGAClientId = '${apiPrefix}getFlutterGAClientId'; -/// DevTools GA properties APIs: -const apiResetDevTools = '${apiPrefix}resetDevTools'; -const apiGetDevToolsFirstRun = '${apiPrefix}getDevToolsFirstRun'; - abstract class PreferencesApi { /// Returns the preference value in the DevTools store file for the key /// specified by the [preferenceKeyProperty] query parameter. diff --git a/packages/devtools_shared/lib/src/server/devtools_store.dart b/packages/devtools_shared/lib/src/server/devtools_store.dart index b306c4c6df2..00f9558d874 100644 --- a/packages/devtools_shared/lib/src/server/devtools_store.dart +++ b/packages/devtools_shared/lib/src/server/devtools_store.dart @@ -5,18 +5,6 @@ import 'file_system.dart'; enum DevToolsStoreKeys { - /// The key holding the value for whether Google Analytics (legacy) for - /// DevTools have been enabled. - @Deprecated( - 'Use unified_analytics instead; this key is for legacy analytics and will ' - 'be removed.', - ) - analyticsEnabled, - - /// The key holding the value for whether this is a user's first run of - /// DevTools. - isFirstRun, - /// The key holding the value for the last DevTools version that the user /// viewed release notes for. lastReleaseNotesVersion, @@ -59,19 +47,14 @@ class DevToolsUsage { late IOPersistentProperties properties; - void reset() { - properties.remove(DevToolsStoreKeys.isFirstRun.name); - } - void _removeLegacyKeys() { // TODO(https://github.com/flutter/devtools/issues/9775): remove this logic - // once legacy keys have been removed for ~1 year. - properties.remove(DevToolsStoreKeys.analyticsEnabled.name); - } - - bool get isFirstRun { - return properties[DevToolsStoreKeys.isFirstRun.name] = - properties[DevToolsStoreKeys.isFirstRun.name] == null; + // once legacy keys have been removed for ~1 year. We are intentionally + // using raw strings instead of values from [DevToolsStoreKeys] to avoid + // unnecessary breaking changes in the future. + properties + ..remove('analyticsEnabled') + ..remove('isFirstRun'); } bool surveyNameExists(String surveyName) => properties[surveyName] != null; diff --git a/packages/devtools_shared/lib/src/server/server_api.dart b/packages/devtools_shared/lib/src/server/server_api.dart index f385060eca1..4cc838a52ca 100644 --- a/packages/devtools_shared/lib/src/server/server_api.dart +++ b/packages/devtools_shared/lib/src/server/server_api.dart @@ -82,16 +82,6 @@ class ServerApi { api: api, ); - // ----- DevTools Store. ----- - - case apiResetDevTools: - _devToolsStore.reset(); - return _encodeResponse(true, api: api); - case apiGetDevToolsFirstRun: - // Has DevTools been run first time? To bring up analytics dialog. - final isFirstRun = _devToolsStore.isFirstRun; - return _encodeResponse(isFirstRun, api: api); - // ----- Preferences api. ----- case PreferencesApi.getPreferenceValue: return _PreferencesApiHandler.getPreferenceValue(