MetaMask / MetaMask/metamask-mobile
[Bug]: Error while trying to Cancel in between the Send operation
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
**Describe the bug**
Observed App crashing (though not reprodicible always), but errors displayed in logs when trying to Cancel in between the Send operation.
> WARN Selector _temp returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
> Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization
>
> Code: useMoneyAccount.ts
> 94 | const vaultConfig = useSelector(selectMoneyAccountVaultConfig);
> 95 | const primaryMoneyAccount = useSelector(selectPrimaryMoneyAccount);
> 96 | const prefillConfig = useSelector((state: RootState) =>
> | ^
> 97 | selectPrefilledAmountConfig(state, 'moneyAccountDeposit'),
> 98 | );
> 99 | const { navigateToConfirmation } = useConfirmNavigation();
> Call Stack
> useMoneyAccountDeposit (app/components/UI/Money/hooks/useMoneyAccount.ts:96:36)
> MoneyEarnBannerContent (app/components/UI/Money/components/MoneyEarnBanner/MoneyEarnBanner.tsx:178:53)
> LOG [MetaMask DEBUG]: PerpsController state persisted successfully
> LOG [MetaMask DEBUG]: ComplianceController state persisted successfully
> LOG [MetaMask DEBUG]: AssetsController state persisted successfully
> LOG [MetaMask DEBUG]: PerpsController state persisted successfully
> LOG [MetaMask DEBUG]: GasFeeController state persisted successfully
> LOG [MetaMask DEBUG]: AssetsController state persisted successfully
> LOG [MetaMask DEBUG]: AssetsController state persisted successfully
> LOG [MetaMask DEBUG]: RampsController state persisted successfully
> ERROR Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props. onStartShouldSetResponder
> LOG [MetaMask DEBUG]: GasFeeController state persisted successfully
> LOG [MetaMask DEBUG]: TransactionController state persisted successfully
> LOG [MetaMask DEBUG]: RampsController state persisted successfully
> LOG [MetaMask DEBUG]: GasFeeController state persisted successfully
> LOG [MetaMask DEBUG]: AssetsController state persisted successfully
> LOG [MetaMask DEBUG]: TransactionController state persisted successfully
> LOG [MetaMask DEBUG]: PredictController state persisted successfully
> LOG [MetaMask DEBUG]: TransactionController state persisted successfully
> LOG [MetaMask DEBUG]: PhishingController state persisted successfully
> LOG [MetaMask DEBUG]: AssetsController state persisted successfully
> WARN [MetaMask DEBUG]: [Error: Approval request with id '41e84da0-96e0-11f1-9725-494c6ac5da67' not found.]
> LOG [MetaMask DEBUG]: TransactionController state persisted successfully
> ERROR [Error: Uncaught (in promise, id: 48): "Error: MetaMask Tx Signature: User denied transaction signature."]
**Steps to reproduce**
1. Initiate Send operation
2. enter send amount
3. select destination account to send
4. Click on Cancel button and abort the flow
**Error messages or log output**
```shell
```
**Where was this bug found?**
Internal release testing
**Version**
8.7.0
**Build number**
6442
**Build type**
None
**Device**
Pixel 9 Pro XL
**Operating system**
Android
Contributor guide
Research direction
Start with the cancellation flow described in the reproduction steps, then inspect app/components/UI/Money/hooks/useMoneyAccount.ts around line 96 and app/components/UI/Money/components/MoneyEarnBanner/MoneyEarnBanner.tsx around line 178. Reproduce on Android using the listed send and cancel steps while checking the selector warning, approval warning, and denied-signature error. Done means cancelling no longer crashes the app or leaves these cancellation-related errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- frontend, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100