[pull] main from MetaMask:main#424
Merged
Merged
Conversation
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Remove unnecessary bridge-controller resolution and bump bridge
controller
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Updates bridge and transaction controller packages (and lockfile) and
removes an unnecessary bridge-controller resolution.
>
> - **Dependencies**:
> - Bump `@metamask/bridge-controller` to `^64.2.0` in `dependencies`
and lockfile.
> - Bump `@metamask/bridge-status-controller` to `^64.2.0` in lockfile.
> - Bump `@metamask/transaction-controller` to `62.7.0` in
`resolutions`, `dependencies`, and lockfile.
> - **Cleanup**:
> - Remove obsolete `resolutions` entry for
`@metamask/bridge-controller`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f2e82f4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** The tokens list is very badly organized and there is a lot of deprecated code, I have proceeded to reorganize the code and remove the deprecated parts of it as well as removed the dependency on the `isMultichainAccountsState2Enabled` FF. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: improve code quality on tokens list and remove deprecated code ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2159 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Refactors token list architecture, drops the Token Filter sheet/routes, consolidates components/styles, and simplifies price-change logic to prefer multichain data with broad test updates. > > - **Tokens UI/Structure**: > - Reorganized `TokenList` and `TokenListItem` (removed `TokenListItemBip44`), updated imports/paths, and deleted legacy `styles.ts` and `CustomNetworkNativeImgMapping`. > - Localized styles in components (`TokenListItem`, `TokenListSkeleton`, `ScamWarningModal`, `StakeButton`). > - Removed `PortfolioBalance` and tests; Wallet now displays `AccountGroupBalance` only. > - Kept `ScamWarningModal` always mounted; visibility controlled by prop. > - **Navigation**: > - Removed `Routes.SHEET.TOKEN_FILTER` and its screen from `App.tsx`; eliminated `TokensBottomSheet` module. > - `TokenSortBottomSheet` now provides `createTokensBottomSheetNavDetails`; control bars updated to use it. > - **Sorting/Filtering**: > - Deleted `TokenFilterBottomSheet` and related tests; control bars continue to navigate to `NetworkManager` for network selection and `TokenSort` for sorting. > - **Data/Selectors**: > - Replaced `selectSortedTokenKeys` with `selectSortedAssetsBySelectedAccountGroup` in `Tokens`. > - Simplified `useTokenPricePercentageChange` to prefer multichain rates (`selectMultichainAssetsRates`) with EVM fallback; removed feature-flag/EVM selection branching. > - **Tests**: > - Updated paths/mocks and removed obsolete tests across token list, control bars, skeletons, and price-change hook to match the new structure. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fb40cc3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…auth preferences (#23989) ## **Description** This PR refactors the authentication preference management system by centralizing all authentication logic in the `Authentication` service and introducing a new public `updateAuthPreference` method. The changes improve code organization, maintainability, and user experience by providing a unified API for managing authentication preferences (biometric, passcode, password, remember me). **Reason for change:** - Authentication preference logic was scattered across multiple UI components (`SecuritySettings`, `LoginOptionsSettings`, `RememberMeOptionSection`), making it difficult to maintain and test - The `storePassword` method was public but should be protected as it's an internal implementation detail - Storage flag management (`BIOMETRY_CHOICE_DISABLED`, `PASSCODE_DISABLED`) was inconsistently handled across components - The "remember me" feature was not properly prioritized over biometric/passcode authentication - UI components lacked proper loading states and cross-toggle disabling, leading to potential race conditions **Improvement/Solution:** - **Centralized authentication logic**: Created a new public `updateAuthPreference` method in `Authentication` service that handles all authentication preference updates - **Protected internal method**: Made `storePassword` a protected method since it's only used internally by the Authentication service - **Centralized storage flag management**: All storage flag logic (`BIOMETRY_CHOICE_DISABLED`, `PASSCODE_DISABLED`) is now managed exclusively within the protected `storePassword` method, ensuring authentication types are mutually exclusive - **Remember me priority**: Updated `checkAuthenticationMethod` to prioritize `REMEMBER_ME` over biometric/passcode when enabled, ensuring remember me takes precedence - **Removed UI-level authentication code**: Removed all authentication-related code from `SecuritySettings.tsx` (removed `storeCredentials`, `setPassword`, `onSignInWithPasscode`, `onSingInWithBiometrics` functions and `loading` state) - **Direct service calls**: Updated `LoginOptionsSettings` and `RememberMeOptionSection` to directly call `Authentication.updateAuthPreference` instead of receiving callbacks as props - **Improved UX**: Added loading indicators (activity indicators replace toggles during operations) and cross-toggle disabling (biometric toggle disables passcode toggle and vice versa) to prevent concurrent operations - **Updated login flow**: Replaced `Authentication.storePassword` with `Authentication.updateAuthPreference` in the login flow - **Comprehensive test coverage**: Added unit tests for `RememberMeOptionSection` and updated `Authentication.test.ts` to cover remember me priority logic ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: Authentication preference management Scenario: User enables biometric authentication Given the user is on the Security Settings screen And biometric authentication is available on the device And the user has a valid password set And passcode authentication is currently disabled When the user toggles biometric authentication ON And enters their password when prompted (if not already stored) Then an activity indicator is shown while processing And the passcode toggle is disabled during the operation And the password is stored with biometric authentication type And biometric authentication is enabled And passcode authentication is disabled (PASSCODE_DISABLED flag set) And the passwordSet Redux action is dispatched Scenario: User enables passcode authentication Given the user is on the Security Settings screen And biometric authentication is available on the device And the user has a valid password set And biometric authentication is currently disabled When the user toggles passcode authentication ON And enters their password when prompted (if not already stored) Then an activity indicator is shown while processing And the biometric toggle is disabled during the operation And the password is stored with passcode authentication type And passcode authentication is enabled And biometric authentication is disabled (BIOMETRY_CHOICE_DISABLED flag set) And the passwordSet Redux action is dispatched Scenario: User enables remember me Given the user is on the Security Settings screen And the user has a valid password set And remember me is currently disabled When the user toggles remember me ON And enters their password when prompted (if not already stored) Then the password is stored with remember me authentication type And remember me is enabled And biometric/passcode authentication is disabled And the passwordSet Redux action is dispatched And remember me takes priority over biometric/passcode on next app unlock Scenario: User disables authentication preference Given the user is on the Security Settings screen And biometric or passcode authentication is currently enabled And the user has a valid password set When the user toggles the authentication preference OFF And enters their password when prompted Then the password is stored with password-only authentication type And both biometric and passcode are disabled And the passwordSet Redux action is dispatched Scenario: User enters invalid password Given the user is on the Security Settings screen And the user is attempting to change authentication preferences When the user enters an invalid password Then an alert is displayed with invalid password message And the error is tracked in analytics And the authentication preference is not changed And the toggle state is reverted Scenario: Remember me takes priority over biometric/passcode Given the user has remember me enabled And biometric authentication is also available and enabled And the user unlocks the app When the app checks authentication method Then remember me authentication is used (not biometric) And the app unlocks without prompting for biometric/passcode ``` ## **Screenshots/Recordings** ### **Before** <!-- No visual changes - this is a refactoring PR with UX improvements (loading indicators) --> ### **After** https://github.com/user-attachments/assets/7f35ddec-2ee4-45cc-af6f-7916b23acd5c <!-- No visual changes - this is a refactoring PR with UX improvements (loading indicators) --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Centralizes auth preference updates in `Authentication.updateAuthPreference`, prioritizes `REMEMBER_ME`, updates settings/login UI with loading/disable states, adds turn-off Remember Me modal, and expands tests with a new storage key. > > - **Authentication Service**: > - Add public `updateAuthPreference(authType, password?)` handling password verification, storage, and Redux side effects; convert biometric-not-enabled to `AUTHENTICATION_APP_TRIGGERED_AUTH_NO_CREDENTIALS`. > - Make `storePassword` protected; centralize `BIOMETRY_CHOICE_DISABLED`/`PASSCODE_DISABLED` management and persist `PREVIOUS_AUTH_TYPE_BEFORE_REMEMBER_ME` for restore. > - Prioritize `REMEMBER_ME` in `getType`/auth method resolution; minor login flow cleanup. > - **Settings UI**: > - Replace callback props with direct calls to `Authentication.updateAuthPreference` in `LoginOptionsSettings` and `RememberMeOptionSection`. > - Add loading indicators and cross-toggle disabling; block changes when Remember Me is on; route to `EnterPasswordSimple` when password is required. > - New `TurnOffRememberMeModal`: validates password, restores previous auth type (or PASSWORD), clears stored previous type, locks app, and dismisses safely during loading. > - **Login**: > - Remove legacy credential storing during vault corruption flow; navigate to restore without updating auth storage. > - **Storage**: > - Add `PREVIOUS_AUTH_TYPE_BEFORE_REMEMBER_ME` key. > - **Tests**: > - Extensive new/updated tests for `Authentication`, settings sections, modal, login, import SRP, and reveal private key; snapshot updated. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2423f6b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
There was a problem where changing dest token to one on a different
network (switching between non-EVM networks in particular) does not
update the destination wallet address, causing the 'get quotes'
functionality to fail. This is solved by checking for valid destination
accounts rather than just checking the chain ID.
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixed bug where requesting quotes for successive
non-EVM networks failed
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Recipient address initialization now validates against destination
accounts and reinitializes when switching chains, fixing non-EVM chain
switching issues.
>
> - **Bridge UI**:
> - **useRecipientInitialization**
(`app/components/UI/Bridge/hooks/useRecipientInitialization.ts`):
> - Add `isDestAddressValidForDestChain` (`useMemo`) to verify
`destAddress` exists in filtered `destinationAccounts` (using
`areAddressesEqual`).
> - Replace chain-type checks with account-validity check and
reinitialize recipient when address is missing/invalid for selected
chain.
> - Update imports and effect dependencies (`useMemo`,
`areAddressesEqual`).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
656afb7. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description** Pass the user's locale to the NativeRampsSdk instances in the Deposit SDK provider. This ensures the SDK can display localized content based on the user's language settings. [SDK PR](https://github.com/consensys-vertical-apps/va-mmcx-native-ramps-sdk/pull/71) ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-2934?atlOrigin=eyJpIjoiZTlmYTFiMzAzOGZmNDA1Yzk3NWIwMWRjOTI0NDE1YTEiLCJwIjoiaiJ9 ## **Manual testing steps** N/A - Internal SDK configuration change. ## **Screenshots/Recordings** N/A - Internal SDK configuration change with no visible UI changes. ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Passes the user’s locale to `NativeRampsSdk` (and updates on changes) in the Deposit SDK; updates tests and bumps `@consensys/native-ramps-sdk` to ^2.1.7. > > - **Deposit SDK (Provider)**: > - Initialize `NativeRampsSdk` with `locale: I18n.locale` for both authenticated instances and `DepositSDKNoAuth` in `app/components/UI/Ramp/Deposit/sdk/index.tsx`. > - Listen to `I18nEvents.localeChanged` to call `sdk.setLocale(locale)` and `DepositSDKNoAuth.setLocale(locale)`. > - Export `DEPOSIT_ENVIRONMENT` (from `getSdkEnvironment`). > - Minor: refine logout error handling typing. > - **Tests** (`app/components/UI/Ramp/Deposit/sdk/index.test.tsx`): > - Expect `locale: 'en'` in `NativeRampsSdk` initialization. > - Replace `SdkEnvironment.Staging` with `DEPOSIT_ENVIRONMENT` usage. > - **Dependencies**: > - Bump `@consensys/native-ramps-sdk` to `^2.1.7` (lockfile updated). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 63345bb. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Fixes the lifecycle of the mock server teardown that was causing issues
with not validating live requests.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds Contentful banner mocks, fixes rewards API mocking
(methods/endpoints) while removing an allowlisted URL, and reorders
cleanup to safely reload RN before mock server shutdown.
>
> - **E2E API mocking**:
> - **Contentful**: Add default mocks for promotional banner queries in
`defaults/contentful-banners.ts` and include in `defaults/index.ts`.
> - **Rewards API**: Correct HTTP methods and coverage in
`defaults/rewards.ts`:
> - `POST /auth/mobile-login` → mocked 401; `POST /public/rewards/ois` →
mocked 200 with empty list.
> - Add `GET /public/seasons/status` and `GET
/public/seasons/{id}/metadata` → mocked 200.
> - **Allowlist**: Remove
`https://rewards.dev-api.cx.metamask.io/auth/mobile-login` from
`mock-e2e-allowlist.ts`.
> - **Fixture/cleanup lifecycle**:
> - In `FixtureHelper.ts`, reload React Native with synchronization
disabled/enabled and perform it before mock server shutdown; validate
live requests earlier; maintain robust error handling.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
49a79e6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…onnection attempts on MetaMask Connect (#24119) ## **Description** Improves UX for MetaMask Connect users in the scenario where they: 1. connect from a dapp via Native Browser 2. go to the wallet 3. do not accept/reject/see the first connection approval 4. return to the dapp 5. attempt a new connection 6. Revisit the wallet and except to see a new connection approval but still see the old one (where accepting the old connection approval will not result in what the user intends, i.e. a working connection) It does this by checking to see if the incoming MMC request is for wallet_createSession and then clearing any pending approvals to ensure stale approvals are cleared out. This does have the side effect of clearing approvals that are not MMC, but is highly unlikely to occur, and can be recovered from gracefully by simply retrying the original request. ## **Changelog** CHANGELOG entry: null MetaMask Connect has not been released to public yet ## **Related issues** Fixes: ## **Manual testing steps** 1. connect from a dapp via Native Browser 2. go to the wallet 3. do not accept/reject/see the first connection approval 4. return to the dapp 5. attempt a new connection 6. Revisit the wallet 7. The first connection approval should disappear automatically 8. Shortly after the new connection approval should appear 9. Accept the connection approval 10. Go back to the dapp 11. You should be connected ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://github.com/user-attachments/assets/a93cffe5-de80-4dc6-a41c-910db1bbde06 ### **After** https://github.com/user-attachments/assets/ea154365-9171-4ad8-b6ec-98d25c16cd9c ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > When receiving `wallet_createSession` from the multichain provider, clear any pending approvals and navigate back before forwarding, with tests updated to cover behavior and new payload shape. > > - **Connection handling (`app/core/SDKConnectV2/services/connection.ts`)**: > - Detects `wallet_createSession` messages from `metamask-multichain-provider`. > - If pending approvals exist: calls `NavigationService.navigation?.goBack()` and clears approvals via `ApprovalController.clear(providerErrors.userRejectedRequest({ data: { cause: 'rejectAllApprovals' } }))`. > - Continues forwarding the original payload to the bridge. > - **Tests (`app/core/SDKConnectV2/services/connection.test.ts`)**: > - Updates payload shape to `{ name, data }` for messages/responses. > - Adds tests for clearing vs. not clearing approvals based on pending count. > - Mocks `Engine.ApprovalController` and `NavigationService` to verify navigation and clearing behavior. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c432aa8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Alex Donesky <adonesky@gmail.com>
## **Description** **Problem** Recent trades in the Perps home screen and asset screen were taking over 3 seconds to show up on the Recent Activity view after placing a trade. This was because the loading state for activity was blocking on both: * WebSocket fills (isFillsLoading) - fast (~100ms when prewarmed) * REST API fills (isRestFillsLoading) - slow (3+ seconds) Additionally, the fills WebSocket channel was not being prewarmed unlike other channels (positions, orders, account), causing the first subscription to have additional latency. Added prewarm support to FillStreamChannel: The fills WebSocket subscription is now prewarmed when entering the Perps environment, ensuring the cache is populated before any component mounts. Enabled fills prewarming in PerpsConnectionManager: Added streamManager.fills.prewarm() call alongside other channel prewarms. Implemented progressive loading: Changed usePerpsHomeData to only wait for WebSocket fills (fast), not REST fills. REST data now loads silently in the background and merges via mergedFills without blocking the initial render. **Trade-offs** The first render shows only WebSocket snapshot data (limited to ~100 recent fills) Full historical data loads in background and appears when ready This is acceptable because the home screen only displays 3 recent trades ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Improved recent trades loading performance in Perps ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2078 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** https://github.com/user-attachments/assets/9560b30d-fdff-4fdd-b166-e450dcd80682 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Prewarms the fills WebSocket channel and updates home data to show activity immediately from WS, merging REST history in the background. > > - **Streams/Providers**: > - Add `prewarm()` and `cleanupPrewarm()` to `FillStreamChannel` to keep fills WS alive and cached. > - **Connection**: > - Preload fills stream via `streamManager.fills.prewarm()` and include its cleanup in `PerpsConnectionManager`. > - **Home Data Hook**: > - Fetch REST fills in background without a loading flag; merge with WS fills via `mergedFills`. > - Set `isLoading.activity` to `isFillsLoading` only (no longer blocks on REST). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ddf7c7f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** This PR fixes sentence case violations in lines 7001-7279 of the `locales/languages/en.json` file as part of ongoing content papercut improvements. The changes convert Title Case strings to sentence case following standard capitalization conventions. **What is the reason for the change?** Content consistency and adherence to proper sentence case formatting across the app. **What is the improvement/solution?** Updated ~15 locale keys from Title Case to sentence case in the Rewards, Transaction, Connection, and Explore sections. ## **Changelog** CHANGELOG entry: Fixed sentence case violations in English locale strings lines 7001-7279 ## **Related issues** Fixes: Part of content papercut improvements batch 8 Follows: #23499 (lines 1-1000), #23516 (lines 1001-2000), #23957 (lines 2001-3000), #23994 (lines 3001-4000), #23996 (lines 4001-5000), #24049 (lines 5001-6000), #24056 (lines 6001-7000) Related: #23272 (original comprehensive PR) ## **Manual testing steps** ```gherkin Feature: Locale string display Scenario: user views UI elements with updated locale strings Given the app is running with the updated locale file When user views Rewards settings Then "Rewards settings" should display in sentence case And "Supported networks" should display in sentence case And "Manage card" should display in sentence case When user views transaction details Then "Bridge send" and "Bridge receive" should display in sentence case And "Funded predict account" should display in sentence case And "Connection error" should display in sentence case When user views Explore tab Then "Trending tokens" should display in sentence case And "Popular sites" should display in sentence case ``` ## **Screenshots/Recordings** ### **Before** N/A - Content-only change (Title Case strings) ### **After** N/A - Content-only change (sentence case strings). No visual differences beyond text casing. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- ## **Technical Details** ### Changes Made: - **Locale file**: Updated ~15 keys in `locales/languages/en.json` (lines 7001-7279) - **Test files**: No test updates needed (content-only changes) ### Affected Areas: - Rewards settings and ways to earn - MetaMask Card management - Transaction details (Perps/Predict deposits, Bridge operations) - Connection error messages - Explore tab (Trending tokens, Popular sites) ### Validation: - Changes are purely cosmetic (text casing only) - No functional changes to app behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Converts Title Case to sentence case for Rewards/Trending/Connection/Transaction i18n strings across multiple locales and updates corresponding tests. > > - **i18n (multi-locale)**: > - Normalize casing to sentence case in `locales/languages/*.json`. > - English: update `rewards.settings.title`, `rewards.ways_to_earn.supported_networks`, `rewards.ways_to_earn.card.sheet.cta_label`, several `transaction_details.title.*` and `transaction_details.summary_title.*` (e.g., `bridge_send_loading`, `bridge_receive_loading`), `sdk_connect_v2.show_error.title`/`show_rejection.title`, `trending.trending_tokens`, and `trending.popular_sites`. > - Other locales (`de`, `el`, `es`, `fr`, `hi`, `id`, `ja`, `ko`, `pt`, `ru`, `tl`, `tr`, `vi`, `zh`): update `sdk_connect_v2.show_rejection.title`, `trending.trending_tokens`, and `trending.popular_sites`. > - **Tests**: > - Adjust expected strings to sentence case in `SwapSupportedNetworksSection.test.tsx`, `WaysToEarn.test.tsx`, and `TrendingTokensFullView.test.tsx` (e.g., `Supported networks`, `Manage card`, `Trending tokens`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2c29019. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Corey Janssen <107953793+coreyjanssen@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
## **Description**
This PR migrates feature flag checks from the custom `useFeatureFlag`
hook to Redux selectors, aligning with the codebase's feature flag
architecture guidelines.
### Reason for change:
- The existing `useFeatureFlag` hook was creating an inconsistent
pattern for accessing feature flags
- Redux selectors provide better memoization, testability, and
integration with the existing state management architecture
- Centralizes feature flag access patterns for better maintainability
### Solution:
- Added new Redux selectors for OTA Updates, Full Page Account List, and
Rewards feature flags
- Each selector includes both a "raw" version (direct flag value) and a
combined version that respects the `basicFunctionalityEnabled` setting
- Updated all consuming components to use `useSelector` with the new
selectors
- Added comprehensive test coverage for all new selectors
- Removed the deprecated `useFeatureFlag` hook
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
Feature: Feature Flag Selectors
Scenario: OTA Updates flag respects basic functionality setting
Given the app has basic functionality enabled
And the remote feature flag for OTA updates is enabled
When the app checks if OTA updates are enabled
Then the selector returns true
Scenario: Full Page Account List flag is disabled when basic
functionality is off
Given the app has basic functionality disabled
And the remote feature flag for full page account list is enabled
When the AccountSelector component renders
Then it uses the non-full-page account list UI
Scenario: Rewards flags work correctly
Given the app has basic functionality enabled
And the rewards feature flags are enabled remotely
When the WaysToEarn component checks mUSD holding flag
Then the appropriate rewards options are displayed##
**Screenshots/Recordings**
### **Before**
N/A - Internal refactoring with no visual changes
### **After**
N/A - Internal refactoring with no visual changes
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )