From 3d350f367f1af70778f0b76abb62284b3199241d Mon Sep 17 00:00:00 2001 From: yashmantri Date: Tue, 16 Jul 2024 16:40:22 +0530 Subject: [PATCH] TP-70982 | Removed analytics perf tracker --- App.tsx | 5 ----- src/common/BlockerScreen.tsx | 4 ---- src/common/CachedImage.tsx | 4 ---- src/hooks/useFirestoreUpdates.ts | 7 ------- 4 files changed, 20 deletions(-) diff --git a/App.tsx b/App.tsx index 9d331ba7..21ead6ab 100644 --- a/App.tsx +++ b/App.tsx @@ -167,11 +167,6 @@ function App() { screen_name: currentRouteName, screen_class: currentRouteName, }); - - await analytics().logEvent('screen_view', { - screen_name: currentRouteName, - screen_class: currentRouteName, - }); }} > diff --git a/src/common/BlockerScreen.tsx b/src/common/BlockerScreen.tsx index 0db0f5a1..5749be53 100644 --- a/src/common/BlockerScreen.tsx +++ b/src/common/BlockerScreen.tsx @@ -17,7 +17,6 @@ import handleBlacklistedAppsForBlockingCosmos, { } from '@services/blacklistedApps.service'; import { addClickstreamEvent } from '@services/clickstreamEventService'; import { setBlacklistedAppsInstalledData } from '@reducers/blacklistedAppsInstalledSlice'; -import perf from '@react-native-firebase/perf'; import { GLOBAL } from '@constants/Global'; import AgentIdCardFlow from '@screens/AgentIdCard'; import { IdCardBlockStatus } from '@reducers/profileSlice'; @@ -103,14 +102,11 @@ const BlockerScreen = (props: IBlockerScreen) => { React.useEffect(() => { const appStateChange = AppState.addEventListener('change', async (change) => { setTimeout(async () => { - const trace = await perf().startTrace('blacklistedAppsInstalled'); - handleBlacklistedAppsForBlockingCosmos().then((blacklistedAppsInstalled) => dispatch( setBlacklistedAppsInstalledData({ blacklistedAppsInstalled: blacklistedAppsInstalled }) ) ); - await trace.stop(); }, 3000); }); return () => appStateChange.remove(); diff --git a/src/common/CachedImage.tsx b/src/common/CachedImage.tsx index 2141d7f1..56363623 100644 --- a/src/common/CachedImage.tsx +++ b/src/common/CachedImage.tsx @@ -4,7 +4,6 @@ import RNFS from 'react-native-fs'; import RNFetchBlob from 'react-native-blob-util'; import FastImage from 'react-native-fast-image'; import { logError } from '../components/utlis/errorUtils'; -import perf from '@react-native-firebase/perf'; interface CachedImageProps { highQualityUri: string; @@ -19,8 +18,6 @@ interface CachedImageProps { export let GlobalImageMap: { [key: string]: string } = {}; export const hydrateGlobalImageMap = async () => { - const trace = await perf().startTrace('hydrateGlobalImageMap'); - RNFS.readdir(RNFS.CachesDirectoryPath) .then(async (result) => { // Filter only files (remove directories from the list) @@ -31,7 +28,6 @@ export const hydrateGlobalImageMap = async () => { GlobalImageMap[cacheFilePath] = `file://${cacheFilePath}`; }); } - await trace.stop(); }) .catch((error) => { console.error('Error reading directory:', error); diff --git a/src/hooks/useFirestoreUpdates.ts b/src/hooks/useFirestoreUpdates.ts index fd9963d4..7b7df11c 100644 --- a/src/hooks/useFirestoreUpdates.ts +++ b/src/hooks/useFirestoreUpdates.ts @@ -2,7 +2,6 @@ import { useEffect, useRef } from 'react'; import firestore, { type FirebaseFirestoreTypes } from '@react-native-firebase/firestore'; import auth from '@react-native-firebase/auth'; import { setFeedbackFilterTemplate } from '@reducers/feedbackFiltersSlice'; -import perf from '@react-native-firebase/perf'; import { InteractionManager } from 'react-native'; import { type RootState } from '../store/store'; import { useAppDispatch, useAppSelector } from '.'; @@ -18,7 +17,6 @@ import { setCurrentProdAPK, setForceUninstallData } from '../reducer/metadataSli import { logError } from '../components/utlis/errorUtils'; import { type GenericFunctionArgs } from '../common/GenericTypes'; import { addClickstreamEvent } from '@services/clickstreamEventService'; -import analytics from '@react-native-firebase/analytics'; import { setCsaFilters } from '@reducers/cosmosSupportSlice'; export interface CaseUpdates { @@ -86,7 +84,6 @@ const useFirestoreUpdates = () => { }; const handleCasesUpdate = async (querySnapshot: FirebaseFirestoreTypes.QuerySnapshot) => { - const trace = await perf().startTrace('handleCasesUpdate'); let newlyAddedCases = 0; let deletedCases = 0; const caseUpdates: CaseUpdates[] = []; @@ -110,7 +107,6 @@ const useFirestoreUpdates = () => { }); }); const isInitialLoad = casesList.length === 0; - await trace.stop(); InteractionManager.runAfterInteractions(() => { requestAnimationFrame(() => { InteractionManager.runAfterInteractions(() => { @@ -129,9 +125,6 @@ const useFirestoreUpdates = () => { addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_SNAPSHOT_LISTENER, { snapshot_path: 'handleCasesUpdate', }); - await analytics().logEvent(CLICKSTREAM_EVENT_NAMES.FA_SNAPSHOT_LISTENER.name, { - snapshot_path: 'handleCasesUpdate', - }); }; const handleCollectionTemplateUpdate = (