From eca11633ec48d209fed99823dab70ea4edb41dbf Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Thu, 25 Jul 2024 09:57:48 -0700 Subject: [PATCH] add tracking for steps ran and final screenwhen closed Reviewed By: antonk52 Differential Revision: D60231269 fbshipit-source-id: 6c836cfdee746a798484c104d8e03e2c4d5980dd --- desktop/flipper-ui/src/app-connection-updates.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-ui/src/app-connection-updates.tsx b/desktop/flipper-ui/src/app-connection-updates.tsx index b825f69f87d..9ce0edef2e2 100644 --- a/desktop/flipper-ui/src/app-connection-updates.tsx +++ b/desktop/flipper-ui/src/app-connection-updates.tsx @@ -13,6 +13,7 @@ import React from 'react'; import {Layout} from './ui'; import {Dialog, getFlipperLib, path} from 'flipper-plugin'; import {getFlipperServer} from './flipperServer'; +import {getLogger} from 'flipper-common'; type ConnectionUpdate = { key: string; @@ -195,8 +196,10 @@ export function DIYConnectivityFix({ type="primary" size="small" onClick={() => { + const step = os === 'iOS' ? 'ios-idb-kill' : 'android-adb-kill'; + logTroubleshootGuideStep(step); getFlipperServer() - .exec(os === 'iOS' ? 'ios-idb-kill' : 'android-adb-kill') + .exec(step) .then(() => { notification.info({ message: `Restarted ${os} connections`, @@ -243,6 +246,7 @@ export function DIYConnectivityFix({ ), ) .then(() => { + logTroubleshootGuideStep('delete-certs'); notification.info({ message: `Certificates deleted`, description: 'Please restart Flipper', @@ -265,6 +269,7 @@ export function DIYConnectivityFix({ type="primary" size="small" onClick={() => { + logTroubleshootGuideStep('restart-flipper'); getFlipperServer() .exec('restart') .then(() => { @@ -292,3 +297,9 @@ export function DIYConnectivityFix({ ); } + +export function logTroubleshootGuideStep(step: string) { + getLogger().track('usage', 'troubleshoot-guide-v2-step', { + step, + }); +}