Skip to content

Commit

Permalink
chore: add logs to identify root cause of issue reported in #1507 (#8414
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gantunesr authored Feb 16, 2024
1 parent 23dc52b commit 2a194b8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/components/Views/LockScreen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,15 @@ class LockScreen extends PureComponent {
async unlockKeychain() {
const { bioStateMachineId } = this.props;
try {
// Retreive the credentials
// Retrieve the credentials
Logger.log('Lockscreen::unlockKeychain - getting credentials');

// Log to provide insights into bug research.
// Check https://github.com/MetaMask/mobile-planning/issues/1507
const { selectedAddress } = this.props;
if (typeof selectedAddress !== 'string') {
Logger.error('unlockKeychain error', 'selectedAddress is not a string');
}
await Authentication.appTriggeredAuth({
selectedAddress: this.props.selectedAddress,
bioStateMachineId,
Expand Down
13 changes: 13 additions & 0 deletions app/components/Views/Login/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ class Login extends PureComponent {
);

try {
// Log to provide insights into bug research.
// Check https://github.com/MetaMask/mobile-planning/issues/1507
const { selectedAddress } = this.props;
if (typeof selectedAddress !== 'string') {
Logger.error('Login error', 'selectedAddress is not a string');
}

await Authentication.userEntryAuth(
password,
authType,
Expand Down Expand Up @@ -435,6 +442,12 @@ class Login extends PureComponent {
const { current: field } = this.fieldRef;
field?.blur();
try {
// Log to provide insights into bug research.
// Check https://github.com/MetaMask/mobile-planning/issues/1507
const { selectedAddress } = this.props;
if (typeof selectedAddress !== 'string') {
Logger.error('unlockKeychain error', 'selectedAddress is not a string');
}
await Authentication.appTriggeredAuth({
selectedAddress: this.props.selectedAddress,
});
Expand Down
2 changes: 2 additions & 0 deletions app/components/Views/ManualBackupStep1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view
import FeatherIcons from 'react-native-vector-icons/Feather';
import { BlurView } from '@react-native-community/blur';
import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english';
import Logger from '../../../util/Logger';
import { baseStyles } from '../../../styles/common';
import StyledButton from '../../UI/StyledButton';
import OnboardingProgress from '../../UI/OnboardingProgress';
Expand Down Expand Up @@ -81,6 +82,7 @@ const ManualBackupStep1 = ({ route, navigation, appTheme }) => {
setView(CONFIRM_PASSWORD);
}
} catch (e) {
Logger.error('Error trying to recover SRP from keyring-controller');
setView(CONFIRM_PASSWORD);
}
}
Expand Down
6 changes: 6 additions & 0 deletions app/components/Views/RestoreWallet/WalletRestored.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Text, {
TextVariant,
} from '../../../component-library/components/Texts/Text';
import StyledButton from '../../UI/StyledButton';
import Logger from '../../../util/Logger';
import { createNavigationDetails } from '../../../util/navigation/navUtils';
import Routes from '../../../constants/navigation/Routes';
import { SafeAreaView } from 'react-native-safe-area-context';
Expand Down Expand Up @@ -49,6 +50,11 @@ const WalletRestored = () => {

const finishWalletRestore = useCallback(async (): Promise<void> => {
try {
// Log to provide insights into bug research.
// Check https://github.com/MetaMask/mobile-planning/issues/1507
if (typeof selectedAddress !== 'string') {
Logger.error('Wallet restore error', 'selectedAddress is not a string');
}
await Authentication.appTriggeredAuth({ selectedAddress });
navigation.replace(Routes.ONBOARDING.HOME_NAV);
} catch (e) {
Expand Down

0 comments on commit 2a194b8

Please sign in to comment.