TP-86072 | Removed Clarity (#957)

This commit is contained in:
Mantri Ramkishor
2024-10-07 16:15:03 +05:30
committed by GitHub
9 changed files with 6 additions and 83 deletions

View File

@@ -40,7 +40,7 @@ import { getPermissionsToRequest } from './src/components/utlis/PermissionUtils'
import ScreenshotBlocker from './src/components/utlis/ScreenshotBlocker';
import { initSentry } from './src/components/utlis/sentry';
import { setItem } from './src/components/utlis/storageHelper';
import { APM_APP_NAME, APM_BASE_URL, ENV } from './src/constants/config';
import { ENV } from './src/constants/config';
import usePolling from './src/hooks/usePolling';
import AuthRouter from './src/screens/auth/AuthRouter';
import { type TDocumentObj } from './src/screens/caseDetails/interface';
@@ -49,7 +49,6 @@ import { addClickstreamEvent } from './src/services/clickstreamEventService';
import { setJsErrorHandler } from './src/services/exception-handler.service';
import fetchUpdatedRemoteConfig from './src/services/firebaseFetchAndUpdate.service';
import { StorageKeys } from './src/types/storageKeys';
import { setCurrentScreenName } from 'react-native-clarity';
import CodePushLoadingModal, { CodePushLoadingModalRef } from './CodePushModal';
initSentry();
@@ -199,7 +198,6 @@ function App() {
ref={navigationRef}
onStateChange={async (state) => {
const currentRouteName = getActiveRouteName(state);
setCurrentScreenName(currentRouteName);
await analytics().logScreenView({
screen_name: currentRouteName,
screen_class: currentRouteName,

View File

@@ -325,6 +325,7 @@ dependencies {
implementation("com.google.firebase:firebase-analytics-ktx")
implementation 'androidx.core:core-splashscreen:1.0.1'
implementation 'com.navi.android:pulse:1.0.1-cosmos'
implementation 'androidx.work:work-runtime-ktx:2.8.1'
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules

View File

@@ -76,7 +76,6 @@
"react-native": "0.70.6",
"react-native-blob-util": "0.17.3",
"react-native-call-log": "2.1.2",
"react-native-clarity": "3.0.0",
"react-native-code-push": "7.1.0",
"react-native-contacts": "7.0.5",
"react-native-device-info": "10.3.0",

View File

@@ -11,7 +11,6 @@ import { getAppVersion } from '../components/utlis/commonFunctions';
import { COLORS } from '../../RN-UI-LIB/src/styles/colors';
import { handleCrash } from '../components/utlis/DeviceUtils';
import crashlytics from '@react-native-firebase/crashlytics';
import { setCustomTag } from 'react-native-clarity';
import { getCurrentScreen } from '@components/utlis/navigationUtlis';
interface IErrorBoundary {
@@ -39,7 +38,6 @@ class ErrorBoundary extends Component<IErrorBoundary, IErrorBoundaryState> {
});
logError(error);
crashlytics().recordError(error);
setCustomTag('jsError', error?.message?.slice(0, 255));
handleCrash({ message: error?.message?.slice(0, 255), screenName: getCurrentScreen()?.name });
}

View File

@@ -11,20 +11,12 @@ import CosmosForegroundService, {
} from '../services/foregroundServices/foreground.service';
import useIsOnline from '../hooks/useIsOnline';
import { getSyncTime, sendCurrentGeolocationAndBuffer } from '../hooks/capturingApi';
import {
isTimeDifferenceWithinRange,
setAsyncStorageItem,
} from '../components/utlis/commonFunctions';
import { isTimeDifferenceWithinRange } from '../components/utlis/commonFunctions';
import { setIsTimeSynced } from '../reducer/foregroundServiceSlice';
import { logError } from '../components/utlis/errorUtils';
import { useAppDispatch, useAppSelector } from '../hooks';
import { dataSyncService } from '../services/dataSync.service';
import {
DATA_SYNC_TIME_INTERVAL,
ENV,
IS_DATA_SYNC_REQUIRED,
MS_CLARITY_PROJECT_ID,
} from '../constants/config';
import { DATA_SYNC_TIME_INTERVAL, IS_DATA_SYNC_REQUIRED } from '../constants/config';
import useIsLocationEnabled from '../hooks/useIsLocationEnabled';
import {
type ISyncCaseIdPayload,
@@ -59,16 +51,10 @@ import { addClickstreamEvent } from '../services/clickstreamEventService';
import { CLICKSTREAM_EVENT_NAMES, LocalStorageKeys } from './Constants';
import useResyncFirebase from '@hooks/useResyncFirebase';
import { imageSyncService, sendImagesToServer } from '@services/imageSyncService';
import getLitmusExperimentResult, {
LitmusExperimentName,
LitmusExperimentNameMap,
} from '@services/litmusExperiments.service';
import { GLOBAL } from '@constants/Global';
import { sendAudiosToServer } from '@services/audioSyncService';
import { sendVideosToServer } from '@services/videoSyncService';
import { getSyncUrl } from '@services/syncJsonDataToBe';
import { handleCheckAndUpdatePullToRefreshStateForNearbyCases } from '@screens/allCases/utils';
import { initialize } from 'react-native-clarity';
import { getWifiDetailsSyncUrl } from '@components/utlis/WifiDetails';
import useFirestoreUpdates from '@hooks/useFirestoreUpdates';
@@ -389,22 +375,6 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
dispatch(getConfigData());
CosmosForegroundService.start(tasks);
resyncFirebase();
const msClarityResponse = await getLitmusExperimentResult(
LitmusExperimentNameMap[LitmusExperimentName.MS_CLARITY],
{ deviceId: GLOBAL.DEVICE_ID }
);
if (
MS_CLARITY_PROJECT_ID &&
!GLOBAL.MS_CLARITY_INITIALIZED &&
msClarityResponse &&
ENV === 'prod'
) {
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.MS_CLARITY_INITIALIZED, {
deviceId: GLOBAL.DEVICE_ID,
});
initialize(MS_CLARITY_PROJECT_ID);
GLOBAL.MS_CLARITY_INITIALIZED = true;
}
}
if (nextAppState === AppStates.BACKGROUND) {
await setItem(StorageKeys.APP_BACKGROUND_TIMESTAMP, now);

View File

@@ -15,7 +15,6 @@ import {
} from '../../common/Constants';
import { ToastMessages } from '../../screens/allCases/constants';
import { alfredHandleSWWEvent } from './DeviceUtils';
import { setCustomTag } from 'react-native-clarity';
export enum ApiKeys {
GENERATE_OTP = 'GENERATE_OTP',
@@ -310,7 +309,6 @@ axiosInstance.interceptors.response.use(
});
}
const { config, response } = error;
setCustomTag('apiError', `API Error occured - ${response?.status}`);
if (response?.status === 400) {
alfredHandleSWWEvent(new Error('API Error occured'));
}

View File

@@ -1,7 +1,6 @@
import { buildFlavour } from '@reducers/metadataSlice';
import { isNullOrUndefined } from '../components/utlis/commonFunctions';
import { setItem } from '@components/utlis/storageHelper';
import { setCustomUserId } from 'react-native-clarity';
export enum DEVICE_TYPE_ENUM {
MOBILE = 'MOBILE',
@@ -55,12 +54,6 @@ export const setGlobalBuildFlavour = (buildFlavour: buildFlavour) => {
if (buildFlavour) GLOBAL.BUILD_FLAVOUR = buildFlavour;
};
export const setMsClarityConfig = (clarityConfig: IClarityConfiguration) => {
if (clarityConfig?.customUserId) {
setCustomUserId(clarityConfig.customUserId);
}
};
export const DOCUMENT_NOT_AVAILABLE = 'Document not available';
export const DOCUMENT_DOWNLOAD_STARTED = 'Downloading has started';
export const CUSTOMER_PROFILE_IMAGE = 'Customer Profile Image';

View File

@@ -4,12 +4,7 @@ import { getUniqueId, isTablet } from 'react-native-device-info';
import { useAppDispatch, useAppSelector } from '../../hooks';
import { type RootState } from '../../store/store';
import { setAgentAttendance, setDeviceId } from '../../reducer/userSlice';
import {
DEVICE_TYPE_ENUM,
GLOBAL,
setGlobalUserData,
setMsClarityConfig,
} from '../../constants/Global';
import { DEVICE_TYPE_ENUM, setGlobalUserData } from '../../constants/Global';
import { registerNavigateAndDispatch } from '../../components/utlis/apiHelper';
import ProtectedRouter from './ProtectedRouter';
import useNativeButtons from '../../hooks/useNativeButton';
@@ -25,19 +20,11 @@ import {
alfredSetPhoneNumber,
alfredSetUserId,
} from '../../components/utlis/DeviceUtils';
import { getAppVersion, setAsyncStorageItem } from '../../components/utlis/commonFunctions';
import { getAppVersion } from '../../components/utlis/commonFunctions';
import useScreenshotTracking from '../../hooks/useScreenshotTracking';
import { getSyncTime } from '@hooks/capturingApi';
import getLitmusExperimentResult, {
LitmusExperimentName,
LitmusExperimentNameMap,
} from '@services/litmusExperiments.service';
import { CLICKSTREAM_EVENT_NAMES, LocalStorageKeys } from '@common/Constants';
import ModalWrapperForAlfredV2 from '@common/ModalWrapperForAlfredV2';
import IdCardApproved from '@screens/AgentIdCard/IdCardStatus/IdCardApproved';
import { ENV, MS_CLARITY_PROJECT_ID } from '@constants/config';
import { initialize } from 'react-native-clarity';
import { addClickstreamEvent } from '@services/clickstreamEventService';
import CallingFeedbackNudgeBottomSheet from '@screens/caseDetails/CallingFlow/BottomSheets/CallingFeedbackNudgeBottomSheet';
function AuthRouter() {
@@ -122,8 +109,6 @@ function AuthRouter() {
selectedAgentId: user?.selectedAgent?.referenceId,
});
setMsClarityConfig({ customUserId: user?.user?.referenceId });
// Sets the dispatch for apiHelper
registerNavigateAndDispatch(dispatch);
@@ -138,20 +123,6 @@ function AuthRouter() {
}
}, [isLoggedIn]);
useEffect(() => {
if (deviceId) {
getLitmusExperimentResult(LitmusExperimentNameMap[LitmusExperimentName.MS_CLARITY], {
deviceId: deviceId,
}).then((response) => {
if (MS_CLARITY_PROJECT_ID && !GLOBAL.MS_CLARITY_INITIALIZED && response && ENV === 'prod') {
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.MS_CLARITY_INITIALIZED, { deviceId });
initialize(MS_CLARITY_PROJECT_ID);
GLOBAL.MS_CLARITY_INITIALIZED = true;
}
});
}
}, [deviceId]);
// Firebase cloud messaging listener
useFCM();
useScreenshotTracking();

View File

@@ -7889,11 +7889,6 @@ react-native-call-log@2.1.2:
resolved "https://registry.yarnpkg.com/react-native-call-log/-/react-native-call-log-2.1.2.tgz#f80d2fcb45f72118eb8048d5bfdef191fd4a3df3"
integrity sha512-nWHmb+QMN/AbbZFEuUGiQePssPgjQr5dibNAURDlqO4S5wuLk1XzxxsLUAVHZnB0FdJoMlajD7tUAXtaoxYwUQ==
react-native-clarity@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/react-native-clarity/-/react-native-clarity-3.0.0.tgz#b9fe0822797aa7c43f8d559d8af6aab3c85c373b"
integrity sha512-z10ebLBKCMjfb2dy+e2/HpXazXDMQxNvhHke174Xc3MVQRBm3obhY7K2PxUZZcUHZays5q/kQRy4imEFAWLYIw==
react-native-code-push@7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/react-native-code-push/-/react-native-code-push-7.1.0.tgz#9767518d684017993ff32875bfd349ce01298d35"