diff --git a/app/components/Nav/App/index.js b/app/components/Nav/App/index.js index 5d395121700..dbed500c1a1 100644 --- a/app/components/Nav/App/index.js +++ b/app/components/Nav/App/index.js @@ -131,6 +131,7 @@ import OptionsSheet from '../../UI/SelectOptionSheet/OptionsSheet'; import FoxLoader from '../../../components/UI/FoxLoader'; import { AppStateEventProcessor } from '../../../core/AppStateEventListener'; import MultiRpcModal from '../../../components/Views/MultiRpcModal/MultiRpcModal'; +import { trace, TraceName, TraceOperation } from '../../../util/trace'; const clearStackNavigatorOptions = { headerShown: false, @@ -579,7 +580,15 @@ const App = (props) => { setOnboarded(!!existingUser); try { if (existingUser) { - await Authentication.appTriggeredAuth(); + await trace( + { + name: TraceName.BiometricAuthentication, + op: TraceOperation.BiometricAuthentication, + }, + async () => { + await Authentication.appTriggeredAuth(); + }, + ); // we need to reset the navigator here so that the user cannot go back to the login screen navigator.reset({ routes: [{ name: Routes.ONBOARDING.HOME_NAV }] }); } else { diff --git a/app/components/Views/LockScreen/index.js b/app/components/Views/LockScreen/index.js index 92f04193389..030bc9ace1d 100644 --- a/app/components/Views/LockScreen/index.js +++ b/app/components/Views/LockScreen/index.js @@ -22,6 +22,7 @@ import { import Routes from '../../../constants/navigation/Routes'; import { CommonActions } from '@react-navigation/native'; import trackErrorAsAnalytics from '../../../util/metrics/TrackError/trackErrorAsAnalytics'; +import { trace, TraceName, TraceOperation } from '../../../util/trace'; const LOGO_SIZE = 175; const createStyles = (colors) => @@ -134,10 +135,19 @@ class LockScreen extends PureComponent { // Retrieve the credentials Logger.log('Lockscreen::unlockKeychain - getting credentials'); - await Authentication.appTriggeredAuth({ - bioStateMachineId, - disableAutoLogout: true, - }); + await trace( + { + name: TraceName.BiometricAuthentication, + op: TraceOperation.BiometricAuthentication, + }, + async () => { + await Authentication.appTriggeredAuth({ + bioStateMachineId, + disableAutoLogout: true, + }); + }, + ); + this.setState({ ready: true }); Logger.log('Lockscreen::unlockKeychain - state: ready'); } catch (error) { diff --git a/app/components/Views/Login/index.js b/app/components/Views/Login/index.js index 59fae180dfd..49771339141 100644 --- a/app/components/Views/Login/index.js +++ b/app/components/Views/Login/index.js @@ -17,7 +17,11 @@ import Text, { } from '../../../component-library/components/Texts/Text'; import StorageWrapper from '../../../store/storage-wrapper'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; -import Button, { ButtonSize, ButtonVariants, ButtonWidthTypes } from '../../../component-library/components/Buttons/Button'; +import Button, { + ButtonSize, + ButtonVariants, + ButtonWidthTypes, +} from '../../../component-library/components/Buttons/Button'; import { fontStyles } from '../../../styles/common'; import { strings } from '../../../../locales/i18n'; import FadeOutOverlay from '../../UI/FadeOutOverlay'; @@ -55,9 +59,19 @@ import { LoginViewSelectors } from '../../../../e2e/selectors/LoginView.selector import { withMetricsAwareness } from '../../../components/hooks/useMetrics'; import trackErrorAsAnalytics from '../../../util/metrics/TrackError/trackErrorAsAnalytics'; import { downloadStateLogs } from '../../../util/logs'; -import TextField, { TextFieldSize } from '../../../component-library/components/Form/TextField'; +import { + trace, + endTrace, + TraceName, + TraceOperation, +} from '../../../util/trace'; +import TextField, { + TextFieldSize, +} from '../../../component-library/components/Form/TextField'; import Label from '../../../component-library/components/Form/Label'; -import HelpText, { HelpTextSeverity } from '../../../component-library/components/Form/HelpText'; +import HelpText, { + HelpTextSeverity, +} from '../../../component-library/components/Form/HelpText'; const deviceHeight = Device.getDeviceHeight(); const breakPoint = deviceHeight < 700; @@ -107,7 +121,7 @@ const createStyles = (colors) => }, footer: { marginVertical: 40, - alignItems: 'center' + alignItems: 'center', }, goBack: { marginVertical: 14, @@ -237,6 +251,10 @@ class Login extends PureComponent { fieldRef = React.createRef(); async componentDidMount() { + trace({ + name: TraceName.LoginToPasswordEntry, + op: TraceOperation.LoginToPasswordEntry, + }); this.props.metrics.trackEvent(MetaMetricsEvents.LOGIN_SCREEN_VIEWED); BackHandler.addEventListener('hardwareBackPress', this.handleBackPress); @@ -360,7 +378,15 @@ class Login extends PureComponent { ); try { - await Authentication.userEntryAuth(password, authType); + await trace( + { + name: TraceName.AuthenticateUser, + op: TraceOperation.AuthenticateUser, + }, + async () => { + await Authentication.userEntryAuth(password, authType); + }, + ); Keyboard.dismiss(); @@ -428,7 +454,15 @@ class Login extends PureComponent { const { current: field } = this.fieldRef; field?.blur(); try { - await Authentication.appTriggeredAuth(); + await trace( + { + name: TraceName.BiometricAuthentication, + op: TraceOperation.BiometricAuthentication, + }, + async () => { + await Authentication.appTriggeredAuth(); + }, + ); const onboardingWizard = await StorageWrapper.getItem(ONBOARDING_WIZARD); if (!onboardingWizard) this.props.setOnboardingWizardStep(1); this.props.navigation.replace(Routes.ONBOARDING.HOME_NAV); @@ -447,6 +481,7 @@ class Login extends PureComponent { }; triggerLogIn = () => { + endTrace({ name: TraceName.LoginToPasswordEntry }); this.onLogin(); }; @@ -529,10 +564,7 @@ class Login extends PureComponent { )} - + {strings('login.title')} @@ -582,19 +614,22 @@ class Login extends PureComponent { style={styles.ctaWrapper} testID={LoginViewSelectors.LOGIN_BUTTON_ID} > - -